On Saturday 06 September 2008 21.08:50 Florian Klaempfl wrote:
> Martin Schreiber schrieb:
>
> > Next problem is that pmsechar(msestring) returns a NIL pointer if
> > msestring = ''. As designed? The behaviour of ansistring and widestring
> > was very useful, I'd like if UnicodeString would behave the same.
>
> Do you have some example code which shows this?

See attachment.
Test result:
"
F:\proj\testcase\fpc\unicode\punicodechar>punicodechartest.exe
4288048
4288048
0
0
0
An unhandled exception occurred at $004016C5 :
EAccessViolation : Access violation
  $004016C5  main,  line 25 of punicodechartest.pas
"
Martin
program punicodechartest;
{$ifdef FPC}{$mode objfpc}{$h+}{$endif}
{$ifdef mswindows}{$apptype console}{$endif}
uses
 {$ifdef FPC}{$ifdef linux}cthreads,{$endif}{$endif}
 sysutils;
var
 astr: ansistring;
 wstr: widestring;
 ustr: unicodestring;
begin
 astr:= '';
 wstr:= '';
 ustr:= '';
 writeln(ptrint(pansichar(astr)));
 flush(output);
 writeln(ptrint(pwidechar(wstr)));
 flush(output);
 writeln(ptrint(punicodechar(ustr)));
 flush(output);
 writeln(ord(pansichar(astr)^));
 flush(output);
 writeln(ord(pwidechar(wstr)^));
 flush(output);
 writeln(ord(punicodechar(ustr)^));
 flush(output);
end.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to