Re: [Boost-bugs] [Boost C++ Libraries] #3332: boost::filesystem::path will get trobule in locale Chinese_Taiwan.950 (windows)

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