[fpc-devel] Unicode support - for the 20th time... ;-)

petr.kristan at epos.cz petr.kristan at epos.cz
Thu Nov 20 10:43:58 CET 2008


On Thu, Nov 20, 2008 at 10:39:00AM +0100, Daniƫl Mantione wrote:
>
>
> Op Thu, 20 Nov 2008, schreef Graeme Geldenhuys:
>
>> On Thu, Nov 20, 2008 at 11:12 AM, Florian Klaempfl
>> <florian at freepascal.org> wrote:
>>>
>>> Ok, two questions for the example above:
>>> - how do you maintain backward compatibility?
>>> - how do you load a plain old ansi file?
>>
>>
>> If the file is UTF-8 or ANSI, the above  should work. UTF-8 was
>> designed to be backward compatible with ANSI. One of the beauties of
>> UTF-8.
>
> Wrong. It was designed to be compatible with ASCII, but incompatible with 
> ANSI. A CP1250 encoded file won't show correctly in an UTF-8 encoded 
> environment.
>
> That's why you have to convert. In the current FPC, the compiler can infer 
> the right conversion from type information only if the string is ansi 
> encoded or UCS2/UTF16 encoded. It simply hasn't type information to do the 
> other transformations correct. Therefore you have to call a function, there 
> is nothing we can change about that.
>
>> But yes, with other encodings it's a problem. And exactly the reason I
>> think TStrings and the whole FPC for that matter should start
>> supporting Unicode somehow.  And that's why I urge all core FPC
>> developers to try and finalize a Unicode design.  Otherwise you leave
>> it up to developers to keep adding such shitty hacks which could cause
>> more issues in the long term - instead of solving issues.
>
> Design is almost final. Just give us time to implement.
Can you summarize design in some document. For us developpers is important
to see the future.

Petr

-- 
Ing. Petr Kristan
.
EPOS PRO s.r.o., Bozeny Nemcove 2625, 530 02 Pardubice
tel: +420 466335223    Czech Republic (Eastern Europe) 
fax: +420 466510709



More information about the fpc-devel mailing list