Announcement

Collapse
No announcement yet.

XML and Unicode ??

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • XML and Unicode ??

    Hi all

    i know haw can i load data from XML completely.
    but, when i tried to get value from and XML (containing UTF-8 characters), the return value is ugly !!
    also i tried to convert returned value from ansi to utf and other convert methods, but was useless !!
    for example i tried to load مهدی but it returned such as ????

    is way to get unicode chars from XML ???

    thanks

  • #2
    I assume this is Arabic? You need to transliterate and save the file with Windows-1256 encoding. You can then load and display the text in AutoPlay Media Studio.

    Click image for larger version

Name:	SCRN-2017-10-07-01.png
Views:	191
Size:	31.7 KB
ID:	298443

    Using UTF encoded files directly will not work.

    Ulrich

    Comment


    • #3
      so thanks Ulrich

      before you answer this post, i used other way to get unicode value and resolved my problem !

      i write my tags in a XML file with ANSI code page
      then load that with TextFile.ReadToString and with below function give my Intended value

      ArgDescription = Part(xml, "<Description>", 1);
      ArgDescription = Part(ArgDescription, "</Description>", 1);

      and Part function is below :
      PHP Code:
      function Part(StringArgsSeparatorArgsPartArgs)
      if (
      StringArgs == "" or SeparatorArgs == "" or PartArgs == ""then
      return "nil";
      end
      Find 
      1;
      Item = {};
      Length String.Length(SeparatorArgs);
      Number 1;
      while (
      Find 0) do
      Find String.Find(StringArgsSeparatorArgs1false);
      if (
      Find 0then
      Item
      [Number] = String.Mid(StringArgs1Find-1);
      StringArgs String.Mid(StringArgsFind+Length, -1);
      else
      Item[Number] = StringArgs;
      end
      if (PartArgs <= Numberthen
      return Item[PartArgs];
      end
      Number 
      Number+1;
      end
      return "nil";
      end 
      but your way is very better than me !

      thanks again

      Comment

      Working...
      X