FMod Posted November 23, 2012 Author Share Posted November 23, 2012 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 More sharing options...
FMod Posted December 6, 2012 Author Share Posted December 6, 2012 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 More sharing options...
twinj Posted December 8, 2012 Share Posted December 8, 2012 Cant you just work with byte streams, block read the changes and modify as necessary? Link to comment Share on other sites More sharing options...
FMod Posted December 8, 2012 Author Share Posted December 8, 2012 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 More sharing options...
Recommended Posts