Notes |
|
(0003619)
|
Ivan
|
2013-06-01 20:18
|
|
For me it works.
This can be either Win-specific or something not related to name of file (e.g. vcmi fails to display in-game map name) |
|
|
(0003620)
|
Tow
|
2013-06-01 20:39
|
|
I confirm that it doesn't work on Windows.
Converting path (that is natively UTF-16) to string probably breaks it.
I believe one solution would be to replace types of all filename/path variables std::string with boost::filesystem::path. That should make it work across the platforms, though would require quite a work. [And I'm not sure what'd be side-effects.] |
|
|
(0003645)
|
Ivan
|
2013-06-02 20:28
|
|
Perhaps convert paths to utf-8? It looks that boost::filesystem supports such conversions and utf8-encoded paths works fine on my side. |
|
|
(0003649)
|
krs
|
2013-06-03 07:33
(edited on: 2013-06-03 07:37) |
|
|
|
(0003651)
|
Tow
|
2013-06-03 09:35
|
|
@ Ivan
> Perhaps convert paths to utf-8? It looks that boost::filesystem supports such conversions
What functoin is that? I looked through boost::filesystem docs and haven't found anything.
@ krs
Both Windows and Linux are Unicode aware. It is that Windows uses UTF-16 and Linux UTF-8.
The string/wstring are just vectors of characters, they are not meant to express encodings. Still, it is common to represent UTF-16 text as windows two-byte-chracter std::wstring and UTF-8 strings as one-byte character std::string.
But we want:
a) have as few platform-specific code as possible
b) be compatible between platforms. Eg. Linux server sends to Windows client StartInfo with non-Ascii path.
There is already wrapper using UTF-8 string on Linux and UTF-16 wstring on Windows — that is boost::filesystem. Using it instead of strings should work on all platforms and should not cause any significant costs.
The remaining problem is serializing it. I guess we could just say that path over net is in UTF-8 and make serializer do any necessary conversions.
[Plus I need to check if it actually allows on windows to open non-ascii file with plain ifstream.] |
|
|
(0003652)
|
Tow
|
2013-06-03 09:39
|
|
|
|
(0003653)
|
Ivan
|
2013-06-03 11:00
|
|
|
|
(0006589)
|
SXX
|
2016-08-28 04:08
|
|
|
|
(0006590)
|
SXX
|
2016-08-28 20:00
|
|
Tested. This one fixed by Zyx-2000 pull request for sure. |
|