Project

General

Profile

Actions

Bug #6765

closed

test_filename_utf8_raw_name and test_filename_euc_jp (test_dir_m17n.rb) fail on non-JapaneseWindows

Added by os97673 (Oleg Sukhodolsky) over 11 years ago. Updated over 11 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 2.0.0dev (2012-07-21) [i386-mingw32]
Backport:
[ruby-core:46589]

Description

It looks like the problem is related to http://bugs.ruby-lang.org/issues/4799
The problem is that these test use "\u3042" as a file name to create and to test its name in ASCII-8BIT mode.
But it expects "\x82\x40" as a result, but this is "\u3042".encode('sjis') ('jsis' is a filesystem encoding
on Japanese Windows).
To fix the test I do changed it to calculate expected file name using original name and filesystem's encoding.
Also, I've added two more tests with Windows-1251 and Windows-1252 symbols as file name.
And they does demonstrated another problem of the test on Windows: result of the function Ruby uses to
get binary version of filename (WideCharToMultiByte) is not deterministric (see
http://msdn.microsoft.com/en-us/library/windows/desktop/dd374047(v=vs.85).aspx#SC_char_conv_func for more details).
This is why I've added additional check to which test to check if at least we have expected file name in case we use fylesystem's encoding.


Files

test_dir_m17n.rb.diff (3.55 KB) test_dir_m17n.rb.diff patch for test_dir_m17n.rb os97673 (Oleg Sukhodolsky), 07/21/2012 09:04 PM
test_dir_m17n.rb.v2.diff (4 KB) test_dir_m17n.rb.v2.diff new version of the patch os97673 (Oleg Sukhodolsky), 07/22/2012 12:30 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0