build-cpp / cmkr

Modern build system based on CMake and TOML.
https://cmkr.build
MIT License
423 stars 28 forks source link

Fix encoding #132

Closed gmh5225 closed 7 months ago

gmh5225 commented 7 months ago

Using "ios::binary" can cause encoding issues and result in different generated cmakefiles.

image

mrexodia commented 7 months ago

Binary is used exactly to prevent this problem. Currently the cmakelists files are the same across platforms, removing binary would mess up the newlines between platforms.

gmh5225 commented 7 months ago

If the system language is not English, there will be issues like the above. Should we force the cmakelists file to be UTF-8 formatted

mrexodia commented 7 months ago

Yeah it should already be UTF-8. Do you have an example where this goes wrong? There isn’t any locale-specific data going into the parser as far as I know.

gmh5225 commented 7 months ago

Here is an example. You can check it. https://github.com/gmh5225/test-cmkr-encoding/blob/main/CMakeLists-diff/Report.txt

When I generate the CMakeLists file on my CN system, it is different from the one on the EN system.