* bug#33053: scm_i_mirror_backslashes assumes ASCII-compatible locale encoding
@ 2018-10-15 20:45 Mark H Weaver
2018-10-15 23:06 ` Mark H Weaver
0 siblings, 1 reply; 3+ messages in thread
From: Mark H Weaver @ 2018-10-15 20:45 UTC (permalink / raw)
To: 33053
The 'scm_i_mirror_backslashes' in load.c operates on C strings in the
locale encoding, and assumes that the locale encoding is ASCII
compatible. In the Shift_JIS encoding, used in the "JP_jp.sjis" locale,
backslash '\' is mapped to a multibyte character, and the Yen sign '¥'
is represented using code 0x5C, the same code as backslash '\' in ASCII.
As a result, users of the "JP_jp.sjis" locale will have Yen signs '¥' in
their file names converted into slashes by this function.
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#33053: scm_i_mirror_backslashes assumes ASCII-compatible locale encoding
2018-10-15 20:45 bug#33053: scm_i_mirror_backslashes assumes ASCII-compatible locale encoding Mark H Weaver
@ 2018-10-15 23:06 ` Mark H Weaver
2018-10-20 1:21 ` Mark H Weaver
0 siblings, 1 reply; 3+ messages in thread
From: Mark H Weaver @ 2018-10-15 23:06 UTC (permalink / raw)
To: 33053
Mark H Weaver <mhw@netris.org> writes:
> The 'scm_i_mirror_backslashes' in load.c operates on C strings in the
> locale encoding, and assumes that the locale encoding is ASCII
> compatible. In the Shift_JIS encoding, used in the "JP_jp.sjis" locale,
> backslash '\' is mapped to a multibyte character, and the Yen sign '¥'
> is represented using code 0x5C, the same code as backslash '\' in ASCII.
>
> As a result, users of the "JP_jp.sjis" locale will have Yen signs '¥' in
> their file names converted into slashes by this function.
I miswrote the locale name above. The locale name is "ja_JP.sjis".
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#33053: scm_i_mirror_backslashes assumes ASCII-compatible locale encoding
2018-10-15 23:06 ` Mark H Weaver
@ 2018-10-20 1:21 ` Mark H Weaver
0 siblings, 0 replies; 3+ messages in thread
From: Mark H Weaver @ 2018-10-20 1:21 UTC (permalink / raw)
To: 33053
tags 33053 + notabug
close 33053
thanks
Mark H Weaver <mhw@netris.org> writes:
> Mark H Weaver <mhw@netris.org> writes:
>
>> The 'scm_i_mirror_backslashes' in load.c operates on C strings in the
>> locale encoding, and assumes that the locale encoding is ASCII
>> compatible. In the Shift_JIS encoding, used in the "JP_jp.sjis" locale,
>> backslash '\' is mapped to a multibyte character, and the Yen sign '¥'
>> is represented using code 0x5C, the same code as backslash '\' in ASCII.
>>
>> As a result, users of the "JP_jp.sjis" locale will have Yen signs '¥' in
>> their file names converted into slashes by this function.
>
> I miswrote the locale name above. The locale name is "ja_JP.sjis".
It seems that I was mistaken in my assumption that '\' is mapped to a
multibyte character in Shift_JIS. According to John Cowan, "the
character at #\x5C is *functionally* a backslash that is *displayed* as
a yen sign".
It seems that this is not actually a bug in 'scm_i_mirror_backslashes',
so I'm closing this bug.
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-10-20 1:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-15 20:45 bug#33053: scm_i_mirror_backslashes assumes ASCII-compatible locale encoding Mark H Weaver
2018-10-15 23:06 ` Mark H Weaver
2018-10-20 1:21 ` Mark H Weaver
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).