Conversation
The boost path used wchar_t on Windows. On Czech Windows there was an error: the resulting utf8 string has odd chars, that was incorrectly converted back to wchar in boost path class.
|
please could you provide an example of directory naming in your case? |
|
Of course, there is: |
|
Does it mean that The transformation should be reversible. |
|
Of course in case of modern Windows there shouldn't be any problem in using just std::wstring, as that's the primary string type (althought it's UTF-16 not plain UCS-2). |
Removed unnecessary converting to utf8 The boost path used wchar_t on Windows. On Czech Windows there was an error: the resulting utf8 string has odd chars, that was incorrectly converted back to wchar in boost path class. [close #35]
|
Merged this to |
|
hmmm i hadn't such problems with my russian clients (although they very like to name directories in native language). I think this issue requires additional investigation. |
|
boost::filesystem::path use boost::filesystem::path_traits::convert() to convert std::string back to std::wstring, that use internally. I don't know what it use undercover but I think, it is a different method based on std::codecvt template. |
|
sorry, i haven't yet fully migrate to current implementation of dir_monitor. |
|
It's ok, but isn't it the same function? |
|
no, By the way, looks like we can remove |
|
@Vizor after some investigation i have another portion of questions. |
|
I didn´t. It come from en event, when somthing changes in monitored directory. I have recursive monitoring enabled and then a create subdirectory with the long dash in name (in monitored directory). I use async monitoring, so the wrong utf8 name come into the handler in dir_monitor_event::path. |
|
heh next time please describe you reprodution steps right away. it will help a lot :) @berkus i think you can close this issue. |
|
So the previously invalid name is now handled properly by our utf16 conversion? |
|
previous name is a valid utf8 name... i didn't test especially Vizor's case, but i believe it must be also handled by my PR #39 changes. |
|
although.. current PR actually solves case mentioned by Vizor (appearance of subdirectories of monitored directory with non-ascii names) and my PR 39 solves case with passing non-ascii utf8-encoded string to |
|
Ok, sorry. I thought it was obvious from the modified code. |
|
Sorry guys, I was busy for a while but will get back and review the PRs. Is there anything changed here or the code seems good to go to you? |
The boost path used wchar_t on Windows.
On Czech Windows there was an error: the resulting utf8 string has odd chars, that was incorrectly converted back to wchar in boost path class.