Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3332: boost::filesystem::path will get trobule in locale Chinese_Taiwan.950 (windows)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-08-11 10:32:00
#3332: boost::filesystem::path will get trobule in locale Chinese_Taiwan.950
(windows)
-------------------------------------------------------+--------------------
Reporter: Ching Yi, Chan <chingyichan.tw@â¦> | Owner: bemandawes
Type: Bugs | Status: new
Milestone: Boost 1.40.0 | Component: filesystem
Version: Boost Development Trunk | Severity: Problem
Keywords: encoding cp950 Big5 0x5c |
-------------------------------------------------------+--------------------
Comment(by Ching Yi, Chan <chingyichan.tw@â¦>):
In test-code-and-data.zip contains: test.cpp and test_folder.
the test.cpp use recursive_directory_iterator to travsal test_folder.
but the recursive_directory_iterator cannot travsal it completely because
of the wrong path converted.
test_folder contains this structure:
{{{
test_folder\
å/
foo.txt
åè½ç¸½è¦½/
a.txt
b.txt
å¦ä¸åè³æ夾/
a.txt
b.txt
}}}
the path name contains ãåã is a chinese character which means 'function'.
it last byte is 0x5c ('\\'), when the path try to convert the '\\' to '//'
will make this word broken and the semi-word have the chance to become
antoher chinese character with the first byte in ãåã. that is reason why
we got problem in cp950 at win os.
the test app output is:
{{{
C:\demo-room-workspace\native.impl>test
test_folder\å [directory]
boost::filesystem::basic_directory_iterator constructor: 系統æ¾ä¸å°æå®çè·¯å¾ã:
"test_folder\åååè½ç¸½è¦½"
0.00 s
}}}
the message said: system cannot found the path "test_folder\åååè½ç¸½è¦½".
when path object try to invoke remove_filename() it will calculate the
last of '\'
but ãåã also contains '\' so that remove_filename() got '''test_folder\å
(half of å)''' not '''test_folder'''.
then, path add next path '\' will make the half of å become the whole Big5
char ãåã. the path will be "test_folder\å" not "test_folder\"
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/3332#comment:2> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:01 UTC