<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
This is an issue with Unicode, not UTF8, right?<BR>
ie: a 16 or 20 or 32 bit encoding has the same problem, right?<BR>
<BR>
<BR>
search the web for "unicode precomposed":<BR>
<BR>
<A href="http://en.wikipedia.org/wiki/Precomposed_character">http://en.wikipedia.org/wiki/Precomposed_character</A> <BR> <A href="http://wikisource.org/wiki/Unicode_precomposed_characters">http://wikisource.org/wiki/Unicode_precomposed_characters</A> <BR>
<BR>
or "unicode precomposed apple":<BR>
<BR>
<A href="http://developer.apple.com/jp/qa/qa2001/qa1235.html">http://developer.apple.com/jp/qa/qa2001/qa1235.html</A> <BR><BR>
<A href="http://developer.apple.com/qa/qa2001/qa1235.html">http://developer.apple.com/qa/qa2001/qa1235.html</A> <BR>
<BR>
<BR>
"<BR>When working within Mac OS you will find yourself using a mixture of precomposed and decomposed Unicode. For example, HFS Plus converts all file names to decomposed Unicode, while Macintosh keyboards generally produce precomposed Unicode. This isn't a problem as long as you use system-provided APIs to process text. Apple's APIs correctly handle both precomposed and decomposed Unicode.<BR>
However, you may need to convert to precomposed Unicode when you interact with other platforms. For example, the following are all valid reasons why you might want to convert to precomposed Unicode.<BR>
If you implement a network protocol which is defined to use precomposed Unicode. <BR>When creating a cross-platform file (or volume) whose specification dictates precomposed Unicode. <BR>If you incorporate a large body of cross-platform code into your application, where that code is expecting precomposed Unicode. <BR>"<BR>
<BR>
<A href="http://www.unicode.org/unicode/reports/tr15/index.html">http://www.unicode.org/unicode/reports/tr15/index.html</A> <BR>
<BR> I need to read these.. <BR>
<BR>
<BR> - Jay<BR><BR><BR><BR>> Date: Sun, 21 Dec 2008 15:40:15 +0000<BR>> From: stsp@elego.de<BR>> To: darko@darko.org<BR>> CC: m3devel@elegosoft.com<BR>> Subject: Re: [M3devel] This disgusting TEXT business<BR>> <BR>> On Sun, Dec 21, 2008 at 08:08:57AM +0900, Darko wrote:<BR>> > The right way to do this, IMNSHO is to not assume any particular <BR>> > representation of TEXT values and create an implementation interface <BR>> > that allows implementations of multiple text representations, much like <BR>> > Rd and Wr don't make many assumptions about how data is actually stored <BR>> > or retrieved.<BR>> <BR>> Such an interface may be needed for UTF-8 alone already, anyway,<BR>> because within UTF-8 there is in some cases more than one way<BR>> to store what amounts to the same data to a human user.<BR>> <BR>> In Subversion, from the beginning everyone agreed that the internal<BR>> encoding for all strings would be UTF-8. Most Subversion APIs expect<BR>> data in UTF-8. Strings (e.g. filenames) in the repository are stored<BR>> in UTF-8, etc. Great! Will work in all countries! Right?<BR>> <BR>> Yes, but not on all operating systems if you're not careful!<BR>> It did not occur to anyone at the time that there are characters<BR>> which in UTF-8 have more than one representation (codepoints) in a<BR>> byte stream. For example, an u with umlaut can be encoded as two<BR>> bytes or a single byte:<BR>> <BR>> 2 bytes: [u | the previous character has an umlaut ]<BR>> This is called "normal form decomposed".<BR>> <BR>> 1 byte [u umlaut] (i.e. ü if you can see this on your terminal :)<BR>> This is called "normal form composed".<BR>> <BR>> If you want to be portable, as CM3 and Subversion both try to be,<BR>> you have to consider that some operating systems may return your<BR>> filenames in a different encoding then you stored it in:<BR>> <BR>> --------<BR>> Accepts Gives back<BR>> MacOS X * NFD(*)<BR>> Linux * <input><BR>> Windows * <input><BR>> Others ? ?<BR>> <BR>> <BR>> *) There are some remarks to be made regarding full or partial<BR>> NFD here, but the essential thing is: If you send in NFC, don't<BR>> expect it back!<BR>> -------- quoted from:<BR>> http://svn.collab.net/repos/svn/trunk/notes/unicode-composition-for-filenames<BR>> which is worth a read for more details if you're interested.<BR>> <BR>> In Subversion, this is a real problem for Mac users, because<BR>> two filenames which only differ in their NFC/NFD encoding<BR>> look exactly the same to the user (an u umlaut is printed),<BR>> while the byte streams do not match ("We're sorry, but your<BR>> file x does not exist in the repository!", where x looks just<BR>> like a file that is clearly visible in the repository listing :)<BR>> <BR>> Subversion's problem now is that there are repositories out<BR>> there using filenames in either NFC, NFD, or mixed, and there<BR>> is no good way to reconcile the mess while staying backwards<BR>> compatible with existing clients, servers, working copies and<BR>> repositories. So Mac users are told to only use ASCII characters<BR>> in their filenames to prevent the problem (many users, especially<BR>> users who are not programmers, who store their photos or their<BR>> entire home directory or whatever in Subversion, are not happy<BR>> about this).<BR>> <BR>> This problem may not matter as much in case of CM3, but anyone<BR>> implementing UTF-8 support for CM3 should be aware of this issue<BR>> and not repeat the mistake the Subversion developers made at the<BR>> time! With UTF-8, do not rely on a filename to retain its encoding<BR>> as you passed it to the OS when requesting the filename from the<BR>> OS again.<BR>> <BR>> CM3 should pick either NFD or NFC as internal UTF-8 encoding, for<BR>> filenames only, or for all strings, whichever makes more sense.<BR>> And then stick to it, converting input/output as needed.<BR>> <BR>> Abstracting this problem away using a nice interface would probably<BR>> be the cleanest solution.<BR>> <BR>> Stefan<BR><BR></body>
</html>