Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

reityerukohaku2
Copy link

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.

  • Set the environment variable CL=/utf-8 to fix the codepage used by the compiler to UTF-8
  • Replace the character ä, which is not UTF-8 compatible, with a

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

@NicSavichev
Copy link
Contributor

I have fixed alternatively non-UTF8 symbols in d349960

@reityerukohaku2
Copy link
Author

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

@reityerukohaku2
Copy link
Author

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
Copy link
Author

I have merged d349960 to resolve the conflict

@NicSavichev
Copy link
Contributor

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
Copy link
Author

reityerukohaku2 commented Mar 12, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants