GaijinEntertainment / DagorEngine

Dagor Engine and Tools source code from Gaijin Games KFT
Other
2.14k stars 267 forks source link

🐛 Fixed build_all.cmd error in other language environments #41

Open reityerukohaku2 opened 4 months ago

reityerukohaku2 commented 4 months ago

Overview

Currently, when build_all.cmd is executed in another language environment (e.g. Japanese), a compile error may occur.

This PR is designed to solve that compile error.

Cause

The reason for the error is that Cyrillic characters cannot be used in other language environments that use non-Unicode.

The code page used by the compiler depends on the system locale by default, and most Japanese environments use CP932 for code pages. This may be different in other countries.

Changes

The following modifications have been made to resolve these problems.

I am not sure if the fix is appropriate, so please check and let me know.

NicSavichev commented 4 months ago

I have fixed alternatively non-UTF8 symbols in https://github.com/GaijinEntertainment/DagorEngine/commit/d3499602af19410703e6248439916778231f3878

reityerukohaku2 commented 4 months ago

Thank you for your support. I will test to see if it works properly in my environment.

reityerukohaku2 commented 4 months ago

I have pulled the changes and rebuilt, but I get the following error.

As expected, the compiler does not build using UTF-8 in environments with special system locales, so it is necessary to explicitly use UTF-8 using an environment variable.

If the environment variable "CL=/utf-8" was set just before the build, no compile error occurred. Therefore, changes to build_all.cmd are necessary.

blk_parser.cpp
de_aboutdlg.cpp
..\..\prog\tools\sceneTools\daEditorX\de_aboutdlg.cpp(1): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss  
..\..\prog\tools\sceneTools\daEditorX\de_aboutdlg.cpp(220): error C2001: newline in constant
..\..\prog\tools\sceneTools\daEditorX\de_aboutdlg.cpp(221): error C2146: syntax error: missing ')' before identifier 'addLine'
..\..\prog\tools\sceneTools\daEditorX\de_aboutdlg.cpp(221): error C2146: syntax error: missing ';' before identifier 'addLine'
..\..\prog\tools\sceneTools\daEditorX\de_aboutdlg.cpp(226): error C2001: newline in constant
..\..\prog\tools\sceneTools\daEditorX\de_aboutdlg.cpp(227): error C2146: syntax error: missing ')' before identifier 'addLine'
..\..\prog\tools\sceneTools\daEditorX\de_aboutdlg.cpp(227): error C2146: syntax error: missing ';' before identifier 'addLine'
..\..\prog\tools\sceneTools\daEditorX\de_aboutdlg.cpp(232): error C2001: newline in constant
..\..\prog\tools\sceneTools\daEditorX\de_aboutdlg.cpp(233): error C2146: syntax error: missing ')' before identifier 'addLine'
..\..\prog\tools\sceneTools\daEditorX\de_aboutdlg.cpp(233): error C2146: syntax error: missing ';' before identifier 'addLine'
..\..\prog\tools\sceneTools\daEditorX\de_aboutdlg.cpp(246): error C2001: newline in constant
..\..\prog\tools\sceneTools\daEditorX\de_aboutdlg.cpp(247): error C2146: syntax error: missing ')' before identifier 'addLine'
..\..\prog\tools\sceneTools\daEditorX\de_aboutdlg.cpp(247): error C2146: syntax error: missing ';' before identifier 'addLine'
DagorEngine\prog\3rdPartyLibs\fast_float\fast_table.h(1): error C2220: the following warning is treated as an error
DagorEngine\prog\3rdPartyLibs\fast_float\fast_table.h(1): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
reityerukohaku2 commented 4 months ago

I have merged d349960 to resolve the conflict

NicSavichev commented 4 months ago

I have pulled the changes and rebuilt, but I get the following error.

As expected, the compiler does not build using UTF-8 in environments with special system locales, so it is necessary to explicitly use UTF-8 using an environment variable.

Please, retest updated master once more. And may be tell me what CL to set locally to get your initial env. CL=/utf-8 surely can be added to batch file but maybe better to add it to jam action (vc*-cpp.jam) before calling cl.exe

reityerukohaku2 commented 4 months ago

And may be tell me what CL to set locally to get your initial env.

In my initial environment, the system locale is Shift-JIS, and Shift-JIS is also used in cl. However, I don't know how to explicitly force cl to use Shift-JIS...

Please, retest updated master once more.

OK, I'll try it.

CL=/utf-8 surely can be added to batch file but maybe better to add it to jam action (vc*-cpp.jam) before calling cl.exe

Sorry, I don't understand this very well, so I will do some research.