diff --git a/src/main/kotlin/org/cubewhy/celestial/Celestial.kt b/src/main/kotlin/org/cubewhy/celestial/Celestial.kt index 61253d8c..cb745d54 100644 --- a/src/main/kotlin/org/cubewhy/celestial/Celestial.kt +++ b/src/main/kotlin/org/cubewhy/celestial/Celestial.kt @@ -614,6 +614,10 @@ object Celestial { } log.info("Args was dumped to $launchScript") log.info("Natives file: $natives") + // check non-ascii chars on Microsoft Windows + if (OSEnum.current == OSEnum.Windows && argsString.hasNonAscii()) { + JOptionPane.showMessageDialog(this.launcherFrame, f.getString("gui.non-ascii.warn"), "Warning", JOptionPane.WARNING_MESSAGE) + } return natives // success } @@ -711,3 +715,13 @@ object Celestial { } } } + +private fun String.hasNonAscii(): Boolean { + // todo make it high performance + this.toCharArray().forEach { + if (it.code !in 0..127) { + return false + } + } + return true +} diff --git a/src/main/kotlin/org/cubewhy/celestial/gui/elements/GuiVersionSelect.kt b/src/main/kotlin/org/cubewhy/celestial/gui/elements/GuiVersionSelect.kt index 2c62598c..25472cde 100644 --- a/src/main/kotlin/org/cubewhy/celestial/gui/elements/GuiVersionSelect.kt +++ b/src/main/kotlin/org/cubewhy/celestial/gui/elements/GuiVersionSelect.kt @@ -30,6 +30,7 @@ import org.cubewhy.celestial.gui.GuiLauncher import org.cubewhy.celestial.utils.CrashReportType import org.cubewhy.celestial.utils.FileUtils.unzipNatives import org.cubewhy.celestial.utils.GuiUtils +import org.cubewhy.celestial.utils.OSEnum import org.cubewhy.celestial.utils.SystemUtils.callExternalProcess import org.cubewhy.celestial.utils.SystemUtils.findJava import org.cubewhy.celestial.utils.TextUtils.dumpTrace diff --git a/src/main/resources/languages/launcher.properties b/src/main/resources/languages/launcher.properties index e4298697..e111883b 100644 --- a/src/main/resources/languages/launcher.properties +++ b/src/main/resources/languages/launcher.properties @@ -257,4 +257,8 @@ Paste the link from the browser into Celestial and click OK\n\ Special thanks: ChatGPT, procbridge\n\ Disclaimer: Celestial is open source software. If your account is stolen, we have nothing to do with it. If you open the login window without clicking the login button,\n\ please ignore it! +gui.non-ascii.warn=Warning: Celestial's support for Windows is not very good, and your startup command contains non-ascii characters\n\ +This may cause startup failure!\n\ +\n\ +*Celestial is cross-platform, why not try Linux? diff --git a/src/main/resources/languages/launcher_en.properties b/src/main/resources/languages/launcher_en.properties index 32c875be..32975986 100644 --- a/src/main/resources/languages/launcher_en.properties +++ b/src/main/resources/languages/launcher_en.properties @@ -257,3 +257,7 @@ Paste the link from the browser into Celestial and click OK\n\ Special thanks: ChatGPT, procbridge\n\ Disclaimer: Celestial is open source software. If your account is stolen, we have nothing to do with it. If you open the login window without clicking the login button,\n\ please ignore it! +gui.non-ascii.warn=Warning: Celestial's support for Windows is not very good, and your startup command contains non-ascii characters\n\ +This may cause startup failure!\n\ +\n\ +*Celestial is cross-platform, why not try Linux? diff --git a/src/main/resources/languages/launcher_ja.properties b/src/main/resources/languages/launcher_ja.properties index f33f7222..41a18ec5 100644 --- a/src/main/resources/languages/launcher_ja.properties +++ b/src/main/resources/languages/launcher_ja.properties @@ -268,4 +268,8 @@ Celestial はウィンドウをポップアップし、リンクを自動的に 特別な感謝: ChatGPT、procbridge\n\ 免責事項: Celestial はオープン ソース ソフトウェアです。アカウントが盗まれた場合、当社はそれとは何の関係もありません。ログイン ボタンをクリックせずにログイン ウィンドウを開いた場合、\n\ 無視してください! +gui.non-ascii.warn=警告: Celestial の Windows サポートはあまり良くなく、起動コマンドに非 ASCII 文字が含まれています\n\ +これにより起動エラーが発生する可能性があります!\n\ +\n\ +*Celestial はクロスプラットフォームです。オープンソースで無料の Linux を試してみてはいかがでしょうか? diff --git a/src/main/resources/languages/launcher_ko.properties b/src/main/resources/languages/launcher_ko.properties index d539a539..ce511506 100644 --- a/src/main/resources/languages/launcher_ko.properties +++ b/src/main/resources/languages/launcher_ko.properties @@ -270,3 +270,7 @@ Celestial이 팝업창을 띄우고 자동으로 링크를 복사합니다. 이 특별 감사: ChatGPT, procbridge\n\ 면책 조항: Celestial은 오픈 소스 소프트웨어입니다. 귀하의 계정이 도난당하더라도 당사는 이와 관련이 없습니다. 로그인 버튼을 클릭하지 않고 로그인 창을 열면\n\ 무시해주세요! +gui.non-ascii.warn=경고: Celestial의 Windows 지원은 그리 좋지 않으며 시작 명령에 ASCII가 아닌 문자가 포함되어 있습니다.\n\ +이로 인해 시작 오류가 발생할 수 있습니다!\n\ +\\N\ +*Celestial은 크로스 플랫폼입니다. 오픈 소스와 무료 Linux를 사용해 보는 것은 어떨까요? diff --git a/src/main/resources/languages/launcher_zh.properties b/src/main/resources/languages/launcher_zh.properties index 3523ef84..c1931e4f 100644 --- a/src/main/resources/languages/launcher_zh.properties +++ b/src/main/resources/languages/launcher_zh.properties @@ -259,4 +259,8 @@ Celestial就会弹出一个窗口并自动复制链接, 这时候打开一个InP 特别鸣谢: ChatGPT, procbridge\n\ 免责声明: Celestial是开源软件, 若你的账户被盗, 与我们无关, 如果你没有点击登录按钮却打开了登录窗口,\n\ 请不要理会! +gui.non-ascii.warn=警告: Celestial对Windows的支持并不是很好,而你的启动指令中带有非ascii字符\n\ +这可能导致启动失败!\n\ +\n\ +*Celestial是跨平台的, 为何不尝试一下开源免费的Linux呢