On Thu, 09 Oct 2014 12:03:15 -0500, Aric Stewart wrote:
dlls/kernel32/path.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Hi Aric, Thank you for pointing this out, but unfortunately this seems not to be perfect. Because certain DBCS trail byte range is overlapped its lead byte range [1].
To demonstrate this issue, I attached additional test. The first case (0x955c,0x97a0=表裏) is now pass by your patch, but the second one (0x838f,0x8343,0x8393=ワイン) is failure.
In my opinion, the solution is looking up the path separator from the beginning of the string like _mbsrchr() in msvcrt.
If you have a further question about this, please contact me.
[1] For CP 932 (Japanese Shift JIS), Double byte character: Lead byte (first byte): 0x81-0x9f or 0xe0-0xfc, and Trail byte (second byte): 0x40-0x7e or 0x80-0xfc. Single byte character: 0x00-0x7f, 0xa1-0xdf.
Regards, Akihiro Sagawa
On 10/10/14, 10:45 AM, Akihiro Sagawa wrote:
On Thu, 09 Oct 2014 12:03:15 -0500, Aric Stewart wrote:
dlls/kernel32/path.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Hi Aric, Thank you for pointing this out, but unfortunately this seems not to be perfect. Because certain DBCS trail byte range is overlapped its lead byte range [1].
To demonstrate this issue, I attached additional test. The first case (0x955c,0x97a0=表裏) is now pass by your patch, but the second one (0x838f,0x8343,0x8393=ワイン) is failure.
In my opinion, the solution is looking up the path separator from the beginning of the string like _mbsrchr() in msvcrt.
If you have a further question about this, please contact me.
[1] For CP 932 (Japanese Shift JIS), Double byte character: Lead byte (first byte): 0x81-0x9f or 0xe0-0xfc, and Trail byte (second byte): 0x40-0x7e or 0x80-0xfc. Single byte character: 0x00-0x7f, 0xa1-0xdf.
Regards, Akihiro Sagawa
Hello Akihiro-san,
Thank you very much for the investigation here. It is very helpful! I am not as familiar with SJIS as I thought.
I do not have a lot of time. If you feel like you can fix this properly then I am happy to have you fix it. If you are also busy then I will try to get some time to put together a proper fix.
thanks again! -aric