Skip to content

Fix Simplified Chinese installer encoding - #130

Closed
songshugong wants to merge 1 commit into
rmorgan001:masterfrom
songshugong:codex/fix-chinese-installer-mojibake
Closed

Fix Simplified Chinese installer encoding#130
songshugong wants to merge 1 commit into
rmorgan001:masterfrom
songshugong:codex/fix-chinese-installer-mojibake

Conversation

@songshugong

Copy link
Copy Markdown
Contributor

Apologies for the follow-up here. I noticed that my previous installer-language change could result in mojibake in the Simplified Chinese setup UI when the installer is built with Inno Setup 6.2.x.

This PR fixes the installer encoding issue while keeping the existing language-selection behavior intact.

Summary

Fixes Simplified Chinese text corruption in the Inno Setup installer.

The v1.2.2.3/v1.2.2.4 installer can display corrupted Simplified Chinese text in the setup UI when built with Inno Setup 6.2.x. This appears to happen because the installer script lost its UTF-8 BOM after the zh-CN installer text was added. Inno Setup versions before 6.3 still rely on the BOM to reliably detect UTF-8 script files.

What Changed

  • Restores UTF-8 with BOM encoding for Resources/Installer/GreenSwampSetup.iss.
  • Adds a repo-local Resources/Installer/ChineseSimplified.isl, also encoded as UTF-8 with BOM.
  • Points the chinese installer language entry to the repo-local language file instead of relying on compiler:Languages\ChineseSimplified.isl.
  • Keeps the existing installer language behavior:
    • English, French, German, Italian, and Chinese remain available.
    • ShowLanguageDialog=auto is unchanged.
    • The installed server is still registered with /{language}.

Why

The released setup package can show mojibake in the Simplified Chinese installer UI, including both the custom GSS welcome text and standard installer buttons.

Keeping the script and Simplified Chinese .isl file as UTF-8 with BOM makes the build deterministic for Inno Setup 6.2.x and avoids depending on the language files installed on the build machine.

Validation

  • Built ASCOMGSServer1224Setup.exe in my fork using GitHub Actions with Inno Setup 6.2.2.
  • Confirmed the installer build completed successfully.
  • Confirmed both GreenSwampSetup.iss and ChineseSimplified.isl start with the UTF-8 BOM bytes EF BB BF.
  • Confirmed the Chinese installer messages include expected text such as:
    • chinese.WelcomeLabel2
    • ButtonNext=下一步(&N) >
    • LanguageCodePage=936

Notes

This PR only changes installer language encoding and the source of the Simplified Chinese Inno language file. It does not change GS Server runtime behavior, ASCOM dependencies, driver registration logic, or application language resources.

@songshugong
songshugong deleted the codex/fix-chinese-installer-mojibake branch June 15, 2026 17:04
@rmorgan001

Copy link
Copy Markdown
Owner

Problems??

@songshugong

Copy link
Copy Markdown
Contributor Author

Sorry for the confusion. The issue I found is not a major problem: the Simplified Chinese setup UI can show mojibake/garbled text in the installer, like the setup window text and buttons being displayed incorrectly.

I closed this PR because I wanted to review the change again and see if I can make the fix cleaner, especially around whether to include the full ChineseSimplified.isl file or keep the patch smaller. I will resubmit an updated PR shortly after checking that.

@songshugong

Copy link
Copy Markdown
Contributor Author
871781533654_ pic_hd

@songshugong
songshugong restored the codex/fix-chinese-installer-mojibake branch June 15, 2026 17:18
@songshugong songshugong reopened this Jun 15, 2026
@songshugong

Copy link
Copy Markdown
Contributor Author

I think the root cause is the encoding detection of the Inno Setup script.

GreenSwampSetup.iss contains non-ASCII installer text, including Simplified Chinese and also some existing European language strings. With the current Inno Setup 6.2.x build, if this .iss file is saved as UTF-8 without BOM, Inno Setup may not reliably detect it as UTF-8. It can then read the file using an ANSI/codepage interpretation, which causes the text to be compiled into the installer as mojibake/garbled characters.

This is why the problem is very visible in Simplified Chinese, but it is not necessarily limited to Chinese. Similar encoding corruption can also affect other non-ASCII installer language text, such as accented characters in French or German strings, if the file encoding is interpreted incorrectly.

So the problem is not the translation itself. The translation text is valid, but the installer compiler needs to read the .iss file with the correct encoding.

My PR fixes this by making the installer language source deterministic:

  1. GreenSwampSetup.iss is saved with a UTF-8 BOM, so Inno Setup 6.2.x detects it as UTF-8.
  2. The Simplified Chinese Inno language file is included in the repository, instead of depending on the build machine's installed copy.
  3. The installer still keeps the normal language behavior, so English Windows should still get English, and Chinese should only be used when Windows/language selection chooses it.

If you prefer a smaller fix, you can also just check/restore the UTF-8 BOM on GreenSwampSetup.iss. The important point is that the .iss file containing non-ASCII text must be compiled as UTF-8.

@songshugong

Copy link
Copy Markdown
Contributor Author

I tested the released v1.2.2.4 installer with different languages, and this is not limited to Simplified Chinese.

With /LANG=chinese, the Simplified Chinese welcome text is garbled.
With /LANG=german, the installer shows "schlie脽en" and "m枚glicherweise" instead of "schließen" and "möglicherweise".
With /LANG=french, it shows "recommand茅" instead of "recommandé".

So the root cause appears to be the encoding of GreenSwampSetup.iss, not the Chinese translation itself. The file contains non-ASCII installer text for multiple languages, but the current v1.2.2.4 source file has no UTF-8 BOM. With Inno Setup 6.2.x, that can make the compiler read the script using the wrong encoding, and those strings get compiled into the installer as mojibake.

This also explains why the issue may not be obvious on an English Windows system: the installer normally selects English by default, and the English strings are ASCII-only. However, on a French or German Windows system, the installer may select French or German automatically, so those users could see the garbled welcome text by default. On a Chinese Windows system, the issue is much more obvious because the Simplified Chinese text is affected heavily.

@Principia4834

Principia4834 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Handling of files with a BOM as well as CR/LF vs LF line endings need to be done very carefully under Windows and Visual Studio. Editing files on a non-Windows system such as Linus or macOS and moving between can introduce errors.

My working procedure is only to use Inno Setup to edit GSS setup scripts. I have experienced file corruption using both Visual Studio Code and Visual Studio.

I tested earlier install scripts on French and German language Windows and did not see problems. I will trace back over the install script commit history and then identify the changes required to fix the reported issue.

I have inserted the UTF-8 BOM EF BB BF by binary editing of the current script and this restores the character encoding correctly, as least as far as I can tell for all the European languages. I will check the PR later.

@Principia4834

Principia4834 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Pull request #131 fixes language handling in Inno installer script by adding BOM, including new simplified Chinese messages, fixing message box language selection on "Uninstalling" message box, fixed Italian and German messages that had english text

@rmorgan001

Copy link
Copy Markdown
Owner

Songshugong, I've merged Andy's pull request 131 which I believe included your changes too. I've also download your ChineseSimplified.isl file and put it in my languages folder for Inno. Would you mind canceling your PR and test again?

@songshugong

Copy link
Copy Markdown
Contributor Author

I tested the installer built from the latest master on my machine, and the language encoding looks correct now. The previous mojibake issue appears to be fixed.

I have closed my PR because #131 already covers the needed fix, and I do not want to duplicate the changes or add unnecessary noise.

One small note: since ChineseSimplified.isl is still taken from the Inno Setup Languages folder, future release builds should make sure that file is the correct UTF-8/BOM version.

Thanks again for the quick help!

@songshugong
songshugong deleted the codex/fix-chinese-installer-mojibake branch June 17, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants