File tree Expand file tree Collapse file tree
HMCL/src/main/java/org/jackhuang/hmcl/ui/download Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727import org .jackhuang .hmcl .ui .construct .RequiredValidator ;
2828import org .jackhuang .hmcl .ui .construct .Validator ;
2929import org .jackhuang .hmcl .ui .wizard .WizardController ;
30+ import org .jackhuang .hmcl .util .StringUtils ;
3031
31- import java .nio .charset .StandardCharsets ;
3232import java .util .Map ;
3333
3434import static javafx .beans .binding .Bindings .createBooleanBinding ;
@@ -81,7 +81,7 @@ protected void onInstall() {
8181 String name = txtName .getText ();
8282
8383 // Check for non-ASCII characters.
84- if (!StandardCharsets . US_ASCII . newEncoder (). canEncode (name )) {
84+ if (!StringUtils . isASCII (name )) {
8585 Controllers .dialog (new MessageDialogPane .Builder (
8686 i18n ("install.name.invalid" ),
8787 i18n ("message.warning" ),
Original file line number Diff line number Diff line change 4242
4343import java .io .File ;
4444import java .nio .charset .Charset ;
45- import java .nio .charset .StandardCharsets ;
4645import java .util .Map ;
4746import java .util .Optional ;
4847
@@ -153,7 +152,7 @@ protected void onInstall() {
153152 String name = txtModpackName .getText ();
154153
155154 // Check for non-ASCII characters.
156- if (!StandardCharsets . US_ASCII . newEncoder (). canEncode (name )) {
155+ if (!StringUtils . isASCII (name )) {
157156 Controllers .dialog (new MessageDialogPane .Builder (
158157 i18n ("install.name.invalid" ),
159158 i18n ("message.warning" ),
You can’t perform that action at this time.
0 commit comments