Unicode info

Ruslan Zasukhin sunshine at public.kherson.ua
Thu Apr 17 21:15:31 CDT 2003


on 4/17/03 8:08 PM, jda at jda at his.com wrote:

> I've run into a potentially serious problem with Valentina and files
> with unicode characters. Now that RB internally deals with all text
> as unicode, when it passes a file name to Valentina there is the
> possibility that some characters will be multi-byte unicode
> characters.
> 
> Valentina treats these characters as MacRoman (I guess) and uses that
> name in the Finder, which displays as garbage characters. Even worse,
> in once instance I've found that I can reproducibly crash Valentina
> by creating files with unicode characters in them.
> 
> Here's an email I got from Joe on this, which may explain it better than I
> can:

Jon,

This is not bug, this is not implemented feature (if you want).

It is known that OS X now have FSRef descriptor for files that support
Unicode file names and paths. Valentina uses FSSpec descriptors.

So for now you simply need use ONLY MacRoman chars if files names.
I think this is not big problem at all.


> ------------------
> 
>> It turns out that RB does handle the file name properly -- it appears
>> that it is Valentina that does not (I was actually creating the file,
>> a database, via Valentina, feeding it the folderItem obtained with
>> the SaveAsDialog). I hadn't thought that would matter, but it does.
> 
> Oh!  Yes, it certainly would.  Apparently the Valentina call you're
> using does not pay attention to the string encoding, and doesn't
> support UTF-8.
> 
>> But, in trying to find a workaround, I've encountered behavior I
>> can't explain. I thought I could simply reset f.name after Valentina
>> created the file. But that doesn't work  -- the name in the Finder
>> still appears as the MacRoman version of the utf text.
> 
> Well yes; the file's already created at that point.  The damage is
> already done.  In fact the you don't have a FolderItem that refers to
> the file Valentina created; you have one that refers to the one it
> was *supposed* to create, but didn't.
> 
>> Here's the really weird part:
>> 
>> If I enter a plain MacRoman string into the SaveAsDialog and, after
>> the file is created, try to change the file name with
>> 
>> f.name = "tést" // the e has an accent
>> 
>> it works (the name in the Finder is "tést").
> 
> Yes, because in this case the file Valentina created is the same as
> the one f refers to (because you used only ASCII characters, which
> are the same in UTF-8 as in whatever encoding Valentina is assuming).
> 
>> But if I enter a string with characters > 127 in the SaveAsDialog and
>> try to reset the file name with
>> 
>> f.name = "tést"
>> 
>> it is ignored! That is, the file is saved as the *original* name
>> entered in the SaveAsDialog (again, displayed as MacRoman instead of
>> UTF-8).
> 
> Right, because you're just changing f, which doesn't refer to the
> file Valentina actually created.
> 
>> It seems that once f.name has unicode characters in it, it can't be
>> changed (I can't change it with f.name = "Joe", either).
> 
> No, it's simply that you're changing a FolderItem that doesn't refer
> to the file Valentina created.  (Because it didn't create the file
> you told it to.)
> 
>> I'm going to try to create a simple project that demonstrates this
>> and submit it.
> 
> Please submit it to Valentina, not to us.  This is not our bug.

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://listserv.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list