Jump to content

Unicode in int files


FMod

  

5 members have voted

  1. 1. What to do about it?

    • Try a clean solution with external diffs
      1
    • Use non-unicode XComGame.int
      2
    • I know a better way
      0
    • I'm 12 years old and what is this?
      2


Recommended Posts

Huh.

Turns out there is one bug with ASCII conversion. Although it's with XComStrategyGame.int rather than xcomgame.int.

 

The game's credits symbol - which is actually a section sign - doesn't display properly from an ASCII file. Weird thing is, it isn't even a unicode symbol, but Alt+21 ASCII character that's been there since the dark ages.

 

No worries though. Not being a unicode symbol (XComStrategyGame.int doesn't contain any unicode at all) it converts back perfectly and it all works the same. Why wouldn't it, the files are identical. So I'll just have the next version convert files on the fly for patching and then return them to unicode.

That way you can have your cake and eat it too: make changes normally, return it all in unicode to the game.

Link to comment
Share on other sites

  • 2 weeks later...

Just when I thought I was out of the woods.

It turned out that the standard windows conversion method doesn't always read its own output correctly. It's fine for one-way conversion, and even for unicode->ansi->unicode, but not fine for ping-pong at every mod install.

 

So I had to switch to a more reliable method via powershell.

The bad thing is that it won't work on raw XP or Vista, since they don't include it. Fortunately it's a free download from Microsoft, and it's pretty small.

 

There is some good to it, too: now Unicode will be preserved unaltered throughout the conversion process. I can't say I was ever particularly concerned about a few credits losing diacritic marks, but this way it could even work with foreign files.

Link to comment
Share on other sites

Well, one of the problems is that you can't have both 8-bit text and UTF-16 together in one file. And anything that goes into the ini has to be in normal 8-bit text.

 

Another is that a lot of text editors don't support UTF-16. It was never necessary in the first place, since UTF-8 can handle anything UTF-16 can. The only reason I'm even converting things back to UTF-16 is that § symbol which the game engine fails to display in UTF-8.

 

Not sure if there are compact and free alternatives for conversion, should be, but I didn't find anything good.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...