Menu

WideString & LoadMemory error

Help
youra
2004-03-02
2013-01-15
  • youra

    youra - 2004-03-02

    I have small piece of code:

    procedure Load;
    var
      str: String;
    begin
      Str:=XMLStrings.Text;
      DOM.LoadMemory(Str[1], Length(Str));
    end;

    It works, when Str is of String type. When it is WideString, then it raises exception, smth like 'Invalid XML char', but in help it is written that it must work with WideStrings.
    Then I tred following code:

    procedure Load;
    var
      str: String;
    begin
      Str:=UTF8Encode(XMLStrings.Text);
      DOM.LoadMemory(Str[1], Length(Str));
    end;

    It works well, but DOM(my TXpDocumentObject) replaces cyrillic unicode chars with smth like '&#8367' and it doesn't suit me.

    Is there any solution to load xml WideString from memory? It works well, when you load it from unicode file.

     
    • delphiForever

      delphiForever - 2008-03-12

      Hi,

      What delphi version do you use ?

      Kind regards,

      Matthias.

       

Log in to post a comment.