The Wayback Machine - https://web.archive.org/web/20210131075336/https://github.com/DarkstarProject/darkstar/issues/5805
Skip to content
This repository has been archived by the owner. It is now read-only.

DSGame-server fails to compile if Windows locale is set to Japanese #5805

Open
kassisaf opened this issue Mar 24, 2019 · 2 comments
Open

DSGame-server fails to compile if Windows locale is set to Japanese #5805

kassisaf opened this issue Mar 24, 2019 · 2 comments

Comments

@kassisaf
Copy link
Contributor

@kassisaf kassisaf commented Mar 24, 2019

I have:

  • searched existing issues (http://github.com/darkstarproject/darkstar/issues/) to see if the issue I am posting has already been addressed or opened by another contributor
  • checked the commit log to see if my issue has been resolved since my server was last updated

Client Version (type /ver in game) :
N/A

Source Branch (master/stable) :
master

Additional Information (Steps to reproduce/Expected behavior) :
The game server fails to compile if the Windows system locale is set to Japanese. (Windows 10, VS Community 2017) Setting the locale back to English resolves this issue, but also prevents Japanese input from being used in FFXI.

This appears to be related to non-unicode characters in the following files:

  • char_update.cpp
  • packet_system.cpp
  • battleutils.cpp
  • synthutils.cpp

...although I was not able to resolve the issue simply by saving these files in UTF-8 encoding.

Full compile output looks like this:
https://gist.github.com/ababyduck/fcf5f2313a85743b862ac0b9616fc652

To set system locale in Windows 10:
Region & Language Settings > Administrative Language Settings > Change System Locale... > Japanese (Japan) > OK

@zynjec
Copy link
Contributor

@zynjec zynjec commented Mar 24, 2019

More a Visual Studio issue than project issue, the files are already UTF-8 despite what VS claims.

It's caused by the comments all in cyrillic, remove them locally or PR translations I guess.

@kassisaf
Copy link
Contributor Author

@kassisaf kassisaf commented Mar 25, 2019

Thanks @zynjec. I found a few outlying non-ascii characters that were contributing to the issue, but as you said, it's mostly the cyrillic comments. I collected a list of the lines and text that need translation here:

https://gist.github.com/ababyduck/34b3f640e11a3d7b13c26d6ef82f2d8a

Google Translate does an ok job for some of it, but certain things are out of context (e.g. using the word "value" when describing the price of an item, which obviously has a different meaning when discussing code). If a native speaker would like to translate these, I suspect it would be helpful.

Alternatively, I was able to solve the issue by adding /source-charset:IBM437 to Solution Browser > DSGame-server > Properties > Configuration Properties > C/C++ > Command Line > Additional Options. This forces the project to build with an English code page regardless of the system locale. Is it worth PRing this, or would a translation be preferable?

edit: Setting charset to utf-8 rather than IBM437 works as well.

kassisaf added a commit to kassisaf/darkstar that referenced this issue Mar 25, 2019
DSGame-server was failing to compile when the Windows locale was set
to certain non_english locales, due to unsupported characters found
mainly in cyrillic comments. Specifying a utf-8 source allows Visual
Studio to support these regardless of the host machine's locale.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
3 participants