SCRMaps
/
Sign in

When the Korean breaks

A map's text is stored in one of two encodings, and opening it in the wrong one cannot be undone.

8 min read

Every piece of text in a map - the title, force names, location names, the messages in triggers - lives in one list of strings. That list is either cp949 (the Korean codepage) or UTF-8, and nothing in the file says which. Which one the editor reads it as is decided when you launch it.

ScmDraft2.exe -charEncoding=949     # cp949 스트링 맵 / a cp949 map
ScmDraft2.exe -charEncoding=65001   # UTF-8 스트링 맵 / a UTF-8 map
Append it to the target of a shortcut.

The switch does two things: it interprets the existing strings as that encoding, and it writes new strings in that encoding. There is one thing it does not do, and that is the important part - it does not convert the strings already in the map.

If the text looks broken, do not save. Clicking a broken string in the String Editor is enough to write the misread version back, and information is lost in the process. Reopening with the correct encoding does not bring it back.

  1. 1Make a copy of the map. The next step is something you do to a copy.
  2. 2Open it with -charEncoding=949 and look at a force name or the map title. If it reads correctly, it is a cp949 map.
  3. 3If it is broken, close without saving and open it with -charEncoding=65001 instead. If it reads correctly now, it is a UTF-8 map.
  4. 4Fix that encoding as the setting you use for that map. It can differ from map to map.

TrigEditPlus has to match the same encoding: TEP 0.086 goes with -charEncoding=949, and there is a TEP build made for UTF-8. Mismatched, the text looks fine inside TEP and then breaks after you compile - and only the text inside triggers: DisplayText, Transmission, comments.

A Korean syllable is three bytes in UTF-8 and two in cp949. Once the string section passes 65,535 bytes the editor moves to the extended string section and the map then requires Remastered. A text-heavy Korean map in UTF-8 reaches that boundary first.

There is another layer of the same problem on the script side: which encoding $T, EncodeString and GetStringIndex use for a new string has changed three times.

The encoding euddraft gives a new string
0.9.8.9Changed to UTF-8.
0.9.8.11Rolled back to cp949.
0.9.9.9 and laterUTF-8 again, which is where current builds are.

This is why you will find posts in the corpus that contradict each other: one written inside that window and one outside say the opposite, and both were right when written. With anything about encoding, look at the date first.

Which tool, and which version