Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] (PR#9804) Unicode in registry code
Home

[Freeciv-Dev] (PR#9804) Unicode in registry code

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#9804) Unicode in registry code
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Wed, 25 Aug 2004 01:03:52 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9804 >

> [jdorje - Wed Aug 25 07:27:08 2004]:
> 
> Mateusz Stefek wrote:
[..]
> > 5) savegame compatibility
> >    There will be function called secfile_set_fallback_encoding(file,
> > encoding). If the string which is read is not valid utf8, it will be
> > converted from that encoding.
> 
> Easier would be to use secfile_set_encoding().  This encoding is used 
> for writing and reading.  The registry code can accept strings in the 
> program's internal encoding and read/write them into the registry
encoding.

It means that the registry code will convert or just check the encoding
each time a string will be inserted. I'm not sure how it will affect
game saving, but IMO it's not necessary. There is only one place when
the conversion is needed: client option file.

> Of course the registry encoding will be UTF-8.  Except when loading old 
> savegames where it may be latin1 or something else.
We really don't know in which encoding are old savegames saved.
We can assume it's UTF-8 and if the string isn't valid, we treat it as
latin1. It is really rare situation when the correct latin, but not pure
ascii string is also correct in UTF8. This can only happen when two
special characters are next to each other. (It quite rare in Polish and
it looks like it is almost impossible in German)
 

> > - is_ascii
> 
> This might be good for sanity checking.  Note the is_ascii() we have 
> isn't designed to be an exact check for ascii validity but is more of an 
> is_sane_ascii_name() function.
Yes, I mean the real is_ascii()


> > - convert_string (it's in Jason's patch)
> 
> Easy.
> 
> jason
--
mateusz


[Prev in Thread] Current Thread [Next in Thread]