原文链接:https://devblogs.microsoft.com/oldnewthing/20051014-20/?p=33753
Why is the path separator on Japanese Windows the ¥ character? And why is it the ₩ character on Korean Windows? I’ve been prodding Michael Kaplan to delve into the history of this quirk, and he finally gave in to my repeated badgering. (Additional discussion on the Korean Won sign, the Japanese Yen sign, and currency symbols in general.)
为什么日文版 Windows 中的路径分隔符是 ¥ 呢?而为什么韩文版 Windows 中的路径分隔符又是 ₩ 呢?我已经催促 Michael Kaplan 解释一下这个历史小奇观很久了,在我的不断烦扰下他终于把这则故事写了出来。(这里还有一些关于韩元符号、日元符号,以及货币符号的概括性的讨论。)
(译注:以上文内链接已全部失效,以下是文中的重点内容『he finally gave me to my repeated badgering』在 Web Archive 上的存档译文)
原文链接:http://blogs.msdn.com/b/michkap/archive/2005/09/17/469941.aspx
When is a backslash not a backslash?
在什么情况下,反斜线不是反斜线?
The character in question is U+005c, the REVERSE SOLIDUS, also known as the backslash or ‘\’. It is the path separator for Windows, which is encoded at 0x5c across all of the ANSI code pages.
问题中的字符是 U+005C,REVERSE SOLIDUS(反转的斜线),也以『反斜线』或『\』的形式为人所知,它是 Windows 的路径分隔符,在所有 ANSI 代码页中都被编码为 0x5C。
Since path separators are a pretty important requirement, the title of this post may seem a little scary — how could it not be a backslash, a reverse solidus?
鉴于路径分隔符是一项重点需求,这篇博文的标题似乎显得有些吓人——反斜线怎么会不是反斜线(反转的斜线)呢?
Well, on Japanese code page 932, 0x5c is the YEN SIGN, and on Korean code page 949, 0x5c is the WON SIGN.
那是因为,在日文代码页932里,0x5C是日元符号(¥),而在韩文代码页949里,0x5C是韩元符号(₩)。
Which is not to say that 0x5c does not act as a path separator — it still does. And which is also not to say that the Unicode code points for the Yen and the Won (U+00a5 and U+20a9) do act as path separators — because they do not.
不过这并不意味着0x5C(在显示为日元/韩元符号时)不能作为路径分隔符使用——它仍然有效。同样,这也不意味着 Unicode 中日元和韩元的代码点(code point)(U+00A5 和 U+20A9)可以作为路径分隔符使用——因为它们并不是路径分隔符。
Of course the natual round trip mapping between U+005c and 0x5c happens on all code pages, and both U+00a5 and U+20a9 have one-way ‘best fit’ mappings to 0x5c on their respective code pages. This requirement technically went away with Unicode, when the characters were encoded separately.
当然了,像这种在 U+005C和0x5C之间的循环映射在所有的代码页上都会发生,而 U+00A5(日元符号)和U+20A9(韩元符号)则在其对应的代码页上都有到0x5C的『最佳』映射。像这样的需求在技术上都随着 Unicode 的部署使用、使得每个字符都相互独立进行编码后一去不复返了。
However, the issue is not a simple one of there not being space in the old code page and lots of space in Unicode, where customers will instantly move away from the not backslash path separators.
不过,这件事并不是像旧的字符集里没地方、Unicode 字符集里地方多那样简单的事,如果是这样的话,客户们早就立刻从不是以反斜线作为路径分隔符的环境里离开了。
In practice, after many years of code page based systems in Japan and Korea using their respective currency symbols as the path separators, it is believed customers were simply used to this appearance. And there was therefore little interest in changing that appearance (when the system settings were Japanese or Korean) to anything but those symbols.
实际上,在日本和韩国用过多年基于代码页、以其相应的货币符号作为路径分隔符的系统之后,据信客户们早已经习惯于此了,因而也就对将路径分隔符的外观(当其系统设置为日语或韩语时)修改为除此之外的符号这件事不再有什么兴趣。
To support this expectation, Japanese and Korean fonts, whenever the default system locale is set to Japanese or Korean, respectively, will display the currency symbol rather than the backslash when U+005c is shown.
为了响应这种习惯,日语和韩语的字体在系统的默认语言设置为日语或韩语时,也会相应地在显示 U+005C 字符时显示其货币符号,而不是反斜线。
But whether or not this is really what customers want is still an open question. Andrew Tuck of PSS here at Microsoft noted:
不过这是否是客户的真实诉求,仍然有待讨论。微软 PSS 的 Andrew Tuck 提到:
When one of my customer’s from Korea was visiting here, I asked him if it bothered him that the backslash doesn’t appear as a backslash. It did bother him, and he believes it bothers most of his countrymen. However, he was fatalistic about it, “What can we do to change it. It’s been this way for a long time. We are used to it.”
有位韩国客户来访问的时候,我问他是不是对(路径里)反斜线不显示成反斜线这件事感觉烦恼。客户回答说是,并且表示大概他们国家的人都这么认为。不过,他对此已经听天由命了,他说;『反正也做不了来改变这件事了,都这样这么久了,早就习惯了。』
Hardly a glowing recommendation, is it?
这可不算是什么热情的提议,对吧?
And as Norman Diamond noted in his comments on this very blog (in this post), there are plenty of people in Japan who may not care for the convention, either.
同样,就像 Norman Diamond 在这篇文章(译注:请自行前往阅读)下的评论中提及的那样,在日本也有很多人并不在乎这种惯例。
Of course there is no ‘right’ answer here, and I would imagine that you would find plenty of people who would be unhappy with such a change, just as there are those who would be unhappy with the status quo. Which perhaps explains why the status quo seems to be as it is — those people who would like a change are resigned to the idea that it may never happen. And so they are now used to it….
当然了,关于这个问题,其实并没有什么『正确』答案,我也可以想象得到你能找出一大堆对这种修改不满的人,大约会跟对现状不满的人一样多。这大概也解释了为什么至今为止情况一直都能维持现状——抱怨要做出改变的人,大概已经勉为其难地接受了这件事大概永远不会发生这个事实,干脆就接受了。
远嚣 Comment