Hi, Salvo

On 3/4/06, Salvo Isaja wrote:
> Hi Hanzac,
> I'm changing the ISO 9660 driver to ignore and propagate any illegal
> character in file names, instead of halting the processing with an
> error.
I still think that do not accept the illegal 8.3 filename, is not a
bad solution. But still continue to search the next filename.

> About the floppy image you sent me, with file names including Chinese
> characters, the problem is due to the internal character set conversion
> the FAT driver does. This is an old problem we already discussed, I'm
> browsing the list archive. I'm currently assuming that short file names
> are stored in CP437 character set (will become a mount parameter). I
> always convert everything to widechars for internal processing. Before
> returning the short file name to the DOS find APIs, I convert it to the
> character set used by the DPMI driver, that is currently assumed to be
> UTF-8. This causes any character with code >= 128 to become multibyte,
> overflowing the 13-byte buffer of the DOS API and failing with
> ENAMETOOLONG.
Is it fixable? Just reguard the charcode >= 128 are CP437 characters,
although after they are converted into UTF-8, record they're multibyte
but a single character, so it won't be failing with ENAMETOOLONG.

Can we implement such way, just to be DOS compatible now?

> I tested on a Windows XP machine, and it also converts between the
> character set assumed for the FAT file system (CP850 there) and the one
> used by the console or application. This applies to the FindFirstFileA
> and FindNextFileA Win32 APIs. I can't test what happens when the target
> character set causes any character to become longer than in the source
> character set because I'm not able to find/set an appropriate target
> character set for testing (nice, three rows starting with "character
> set" BTW ;-).
I don't know the FS details of WinXP. But in a Simp-Chinese version of
WinXP, the default character set is CP936. See the below test results
...

> If you can test under Windows, please let me know (a screenshot is also
> welcome) how a "dir a: /x" is supposed to behave on your system, and
> the result of a test program like the following:
O.k. I attached the snapshot of the console window.

> >>> ...
> <<<
> In cAlternateFileName I get bytes converted to the Windows ANSI code
> page (CP1252 IIRC) apparently using a "best match" algorithm against
> the "original" CP850 bytes (e.g. box drawing characters converted to
> "+" and "-").
Here is my result:
活动的代码页: 936
请按任意键继续. . .
ConsoleCP: 936 ConsoleOutputCP: 936 FileApisANSI: 1
"command.com" ""
00( ) AE(? C0(? 77(w) 18() 00( ) 00( ) 00( ) 00( ) 00( ) 00( ) 00( )
A8(? FF()
"command.exe" ""
00( ) AE(? C0(? 77(w) 18() 00( ) 00( ) 00( ) 00( ) 00( ) 00( ) 00( )
A8(? FF()
"CTMOUSE.EXE" ""
00( ) AE(? C0(? 77(w) 18() 00( ) 00( ) 00( ) 00( ) 00( ) 00( ) 00( )
A8(? FF()
"DEMO.EXE" ""
00( ) AE(? C0(? 77(w) 18() 00( ) 00( ) 00( ) 00( ) 00( ) 00( ) 00( )
A8(? FF()
"kernel.sys" ""
00( ) AE(? C0(? 77(w) 18() 00( ) 00( ) 00( ) 00( ) 00( ) 00( ) 00( )
A8(? FF()
"landmine.exe" ""
00( ) AE(? C0(? 77(w) 18() 00( ) 00( ) 00( ) 00( ) 00( ) 00( ) 00( )
A8(? FF()
"microwin.exe" ""
00( ) AE(? C0(? 77(w) 18() 00( ) 00( ) 00( ) 00( ) 00( ) 00( ) 00( )
A8(? FF()
"smedit.exe" ""
00( ) AE(? C0(? 77(w) 18() 00( ) 00( ) 00( ) 00( ) 00( ) 00( ) 00( )
A8(? FF()
"wintest.exe" ""
00( ) AE(? C0(? 77(w) 18() 00( ) 00( ) 00( ) 00( ) 00( ) 00( ) 00( )
A8(? FF()
"wrapper.com" ""
00( ) AE(? C0(? 77(w) 18() 00( ) 00( ) 00( ) 00( ) 00( ) 00( ) 00( )
A8(? FF()
"播放器1.txt" "播放器1.TXT"
B2(? A5(? B7(? C5(? C6(? F7(? 31(1) 2E(.) 54(T) 58(X) 54(T) 00( ) A8(? FF()
"播放器2.txt" "播放器2.TXT"
B2(? A5(? B7(? C5(? C6(? F7(? 32(2) 2E(.) 54(T) 58(X) 54(T) 00( ) A8(? FF()
"播放器3.txt" "播放器3.TXT"
B2(? A5(? B7(? C5(? C6(? F7(? 33(3) 2E(.) 54(T) 58(X) 54(T) 00( ) A8(? FF()
"播放器4.txt" "播放器4.TXT"
B2(? A5(? B7(? C5(? C6(? F7(? 34(4) 2E(.) 54(T) 58(X) 54(T) 00( ) A8(? FF()
"操作系统1.txt" "操作系~1.TXT"
B2(? D9(? D7(? F7(? CF(? B5(? 7E(~) 31(1) 2E(.) 54(T) 58(X) 54(T) 00( ) FF()
"人間世1.txt" "人間世1.TXT"
C8(? CB(? E9(? 67(g) CA(? C0(? 31(1) 2E(.) 54(T) 58(X) 54(T) 00( ) 00( ) FF()
"人間世2.txt" "人間世2.TXT"
C8(? CB(? E9(? 67(g) CA(? C0(? 32(2) 2E(.) 54(T) 58(X) 54(T) 00( ) 00( ) FF()
"人間世3.txt" "人間世3.TXT"
C8(? CB(? E9(? 67(g) CA(? C0(? 33(3) 2E(.) 54(T) 58(X) 54(T) 00( ) 00( ) FF()
"人間世4.txt" "人間世4.TXT"
C8(? CB(? E9(? 67(g) CA(? C0(? 34(4) 2E(.) 54(T) 58(X) 54(T) 00( ) 00( ) FF()
"操作系统2.txt" "操作系~2.TXT"
B2(? D9(? D7(? F7(? CF(? B5(? 7E(~) 32(2) 2E(.) 54(T) 58(X) 54(T) 00( ) FF()
"操作系统3.txt" "操作系~3.TXT"
B2(? D9(? D7(? F7(? CF(? B5(? 7E(~) 33(3) 2E(.) 54(T) 58(X) 54(T) 00( ) FF()
"操作系统4.txt" "操作系~4.TXT"
B2(? D9(? D7(? F7(? CF(? B5(? 7E(~) 34(4) 2E(.) 54(T) 58(X) 54(T) 00( ) FF()

Attachment: Clipboard01.png
Description: PNG image

Reply via email to