About Locale Emulator and the concept of locale emulation itself

I came across this program a while ago myself, and was just as amazed by its premise. I looked at the source code, and saw lots of involved low-level NT kernel voodoo I don't understand, instead of the code I tend to use to solve this kind of problem. Truly, this must be an amazing piece of software, I thought... until I tested it with th135 and noticed that it rendered the Music Room text as exactly the same garbage you see when running the game without any locale emulation. Yeah, it did display 東方心綺楼 in the title bar and correctly referenced the 御首頂戴帳 folder, but overall I'd consider this to be a worse alternative to AppLocale.

So I did some research, and it turns out that this thing merely implements the bare minimum of functionality necessary (namely, changing the system ANSI code page in memory) to purportedly keep games from crashing. Anything just a bit more involved (and the text rendering in recent Tasofro games certainly is) appears to be outside of its scope. I wouldn't trust it. (But hey, at least it produces nice crash dumps.)

Oh, and of course th14 would still crash if it is in a path containing characters outside its emulated locale. It saddens me that we have to continue to play this locale game, with any inferior AppLocale knock-off being heralded as The Perfect Solution. On the other hand, thcrap is the proof that you can most solve issues with this locale crud and then some by writing wrapper functions that expect and return UTF-8 instead, and defining a fallback code page (not "locale") for compatibility. Yes, it's a mostly stupid and mindless affair (there are some functions you need to wrap more creatively, but they are few and far between), but given thcrap's premise of being a multilingual patcher, I see no other way. And since it's a rather high-level implementation, it also works on every Windows version since 98, as well as in Wine.

So, for those who are on XP, Vista or Linux and need a solution other than AppLocale, this is how you would use thcrap's UTF-8 wrapper part for any application:

Download thcrap and extract it.

Open Notepad, paste {} , and save this as null.js .

Right-click thcrap_loader.exe and create a new shortcut.

Right-click the new shortcut and click Properties.

Add null.js , followed by a space, followed by the full path to your game's executable, to the end of the the Target field. For example, if you wanted to play Hopeless Masquerade, you'd have something like "C:\Full\path\to\thcrap_loader.exe" null.js "C:\Full\path\to\Touhou 13.5 - Hopeless Masquerade\th135.exe" in the Target field.

Rename the shortcut, and put it anywhere you like.

Run the game by clicking the shortcut.

There will be bugs. I'd like to keep this thing small and simple, and hence, I'll only add functionality once I notice that something needs it; I also wouldn't have a test case otherwise. As a result, it might even break things that would work if you ran the game without any locale emulation at all. Please tell me; I'd like to get these fixed, too.

About Unicode and locales on Windows

Firstly, there is no such thing as a "Unicode locale" (or, to use correct terminology, a system ANSI code page for the UTF-8 encoding). Yes, if Windows had one, we wouldn't have these problems to begin with. However, Microsoft shows no signs of ever moving into this direction. They even have valid reasons; this would break with the entire history on Unicode in Windows, but more on that later.

Instead, every Windows system is set to a specific system code page, which can be one of these. And yes, even though UTF-8 appears in this list, it is impossible to use it as an ANSI code page (which is exactly what we would need).

I agree that changing your system locale is an overly drastic measure that should be disapproved of. If you look at the definition of the term "locale", the code page is only one aspect among many others. It saddens me that this term is used almost synonymously to "code page" in the otaku scene, only because locales on Windows are fixed entities (you cannot, for example, run your system in an American English locale using the Shift-JIS encoding, although that would make perfect sense