[yunqa.de] Re: In DIXml this is a bug about encoding?

  • From: w w <wangwei.njcn@xxxxxxxxx>
  • To: yunqa@xxxxxxxxxxxxx
  • Date: Tue, 1 Sep 2009 11:05:14 +0800

I have now use Delphi2010 ,but DISystemCompat.pas compile error.The error
info is:

[DCC Error] DISystemCompat.pas(134): E2251 Ambiguous overloaded call to
'UTF8ToUnicodeString'
  System.pas(22395): Related method: function UTF8ToUnicodeString(const
PAnsiChar): string;
  DISystemCompat.pas(36): Related method: function UTF8ToUnicodeString(const
PAnsiChar): WideString;
[DCC Error] DISystemCompat.pas(145): E2250 There is no overloaded version of
'Utf8ToUnicode' that can be called with these arguments
[DCC Error] DISystemCompat.pas(174): E2254 Overloaded procedure
'UnicodeToUtf8' must be marked with the 'overload' directive
[DCC Error] DISystemCompat.pas(182): E2250 There is no overloaded version of
'UnicodeToUtf8' that can be called with these arguments
[DCC Warning] DISystemCompat.pas(253): W1044 Suspicious typecast of
Utf8String to PWideChar
[DCC Warning] DISystemCompat.pas(270): W1044 Suspicious typecast of
Utf8String to PWideChar
[DCC Error] DISystemCompat.pas(270): E2250 There is no overloaded version of
'UnicodeToUtf8' that can be called with these arguments
[DCC Error] DISystemCompat.pas(61): E2065 Unsatisfied forward or external
declaration: 'UnicodeToUtf8'
[DCC Fatal Error] DIXml_XPath1_Evaluate.dpr(26): F2063 Could not compile
used unit 'DISystemCompat.pas'

How can I do? thank you!

2009/8/22 Delphi Inspiration <delphi@xxxxxxxx>

> At 11:33 20.08.2009, w w wrote:
>
> >          cur := XPathObj^.NodeSetVal^.NodeTab[i];
> >          WriteLn('= element node ', cur^.Name);
> >          writeln('node value:',ansistring(cur^.Content));
> >
> >if cur^.Content have chinese char,the output is unreadable codes;
>
> cur^.Name and cur^.Content are always UTF-8 encoded, regardless if the
> document input character encoding is Chinese or any other encoding.
>
> Therefore you should convert this UTF-8 back to UTF-16 or your favourite
> encoding. Example:
>
>  cur := Nodes^.NodeTab[i];
>  WriteLn('= element node ', Utf8Decode(cur^.Name));
>  WriteLn('node value:', (Utf8Decode(cur^.Content)));
>
> Ralf
>
> _______________________________________________
> Delphi Inspiration mailing list
> yunqa@xxxxxxxxxxxxx
> //www.freelists.org/list/yunqa
>
>
>
>


-- 
谢谢!
wangwei

Other related posts: