0 Replies Latest reply on Jan 16, 2007 10:34 AM by willie_lee

    Problems with RSS + UTF-8 + String.idexOf

    willie_lee
      Hello,

      Can anyone help me? I've got a problem using the String.indexOf(). I am parsing an RSS feed (mxl) document and I am sure that feed is orginially written in a foriegn character set (Japanese). The xml file gets to me it has been encoded into UTF-8 so I am able to parse it, no problemo. However, I am unable to use the String.indexOf operator to abstract information from the String...
      Thus an item may be retrieved such as...
      <item>"www.youtube.com/movies/902348o2u423o4u.swf"<item>

      parsed
      myItem:String ="www.youtube.com/movies/902348o2u423o4u.swf";

      Using myItem.indexOf("youtube").. does not yield any result... it evaluates to -1. Now what is quite strange is that I am able to parse this string by the individual characters...

      So thus....
      for( var i:Number = 0; i < myItem.length; ++i){
      if(myItem.charAt(i) == 'y'){
      trace("Y character found at "+i);
      }
      }
      yields
      Y character found at 4

      Has anyone every encountered a problems using the String.indexOf parser with XML RSS, possible in a foriegn character set?

      If so could some one tell me why this does not work and what they did for a work around?

      (I am pretty sure I could build my own string parser, but for some reason the boss man who is paying me, wants an explaination as to why this is not working ... and what other people have done....) YEAH me too!



      Thank YOu
      Moozungu....