Re: [fpc-devel] Ansistring code page

2011-10-13 Thread Hans-Peter Diettrich
Jonas Maebe schrieb: On 13 Oct 2011, at 15:02, Paul Ishenin wrote: Then use {$codepage UTF8} only. This directive treats all ansistring constants in UTF8 codepage. So the next code: {$codepage UTF8} var s: ansistring; begin s := 'utf8 string'; WriteLn(StringCodePage(s)); end. will output

Re: [fpc-devel] Ansistring code page

2011-10-13 Thread Paul Ishenin
13.10.2011 21:21, Jonas Maebe wrote: This I don't really understand. This is how delphi works according to my tests. I will retest to be 100% sure. Shouldn't the constant be converted at run time from UTF-8 to the DefaultSystemCodePage to make sure that an ansistring(0) variable always conta

Re: [fpc-devel] Ansistring code page

2011-10-13 Thread Flávio Etrusco
On Thu, Oct 13, 2011 at 7:13 PM, Paul Ishenin wrote: > 13.10.2011 21:21, Jonas Maebe wrote: >> >> This I don't really understand. > > This is how delphi works according to my tests. I will retest to be 100% > sure. > >> Shouldn't the constant be converted at run time from UTF-8 to the >> DefaultSy

[fpc-devel] Ansistring code page (was: bug report 20473: Please add a directive to define string=utf8string)

2011-10-13 Thread Jonas Maebe
On 13 Oct 2011, at 15:02, Paul Ishenin wrote: Then use {$codepage UTF8} only. This directive treats all ansistring constants in UTF8 codepage. So the next code: {$codepage UTF8} var s: ansistring; begin s := 'utf8 string'; WriteLn(StringCodePage(s)); end. will output CP_UTF8 constant. T

Re: [fpc-devel] Ansistring code page (was: bug report 20473: Please add a directive to define string=utf8string)

2011-10-13 Thread Inoussa OUEDRAOGO
> ... the constant be converted at run > time from UTF-8 to the DefaultSystemCodePage to make sure that an > ansistring(0) variable always contains strings encoded in the > DefaultSystemCodePage? If you assign e.g. a string(866) variable to a plain > ansistring variable, then such a conversion is a