[fpc-devel] new string - question on usage

Paul Ishenin webpirat at mail.ru
Tue Oct 11 00:19:15 CEST 2011


11.10.2011 6:10, Martin wrote:
> I wasn't askin for changing the default.
>
> just for how to do
>
> procedure foo(x: utf8string); begin end;
>
> var a: string; //ansistring, but contains already utf8
>
> foo(a); // do not convert
use
foo(x: rawbytestring)
>
>>> And what happens if an app did read data from some external source 
>>> (serial port) and then wants to declare what encoding it is?
>> http://docwiki.embarcadero.com/VCL/en/System.SetCodePage
>>
>>
> I hadn't seen that.
>
> That may help. Though not the best solution...
>
> I can call it before calling the "foo" proc. But I must revert it 
> afterwards, or at sometime later, the string will be translated, when 
> it will be used in a normal string again (yet expected to keep being 
> utf8..
>
> Yes, I know, what i want to do, is not what it was designed for. 
> ultimately a huge update to the entire source will be needed... but 
> now I need a temporary solution until then
Don't use utf8string type until all Lazarus code use it.

Best regards,
Paul Ishenin.



More information about the fpc-devel mailing list