passing specials Chars from xml into flash

  • vinid3
  • Novice
  • Novice
  • vinid3
  • Posts: 17

Post 3+ Months Ago

Hi everybody..
My website is nearly finished! :D
Although, I still have some problems with texts loaded from an external XML
as this website is mostly in franch, I use a lot of french accents and so, no problem at all with this, both flash and my xml document are in UTF8
But I got problems with the " ' ", and the the " " ", I mean, The quotes, double and single...
a quote in the xml is transcoded into """ ... how to display the original quote?

I've been googling for a while, and only found some tricks using heavy and long functions.. isn't there a simply way?

Thanks!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • vinid3
  • Novice
  • Novice
  • vinid3
  • Posts: 17

Post 3+ Months Ago

:)

... the answer was finally found.... giving it in case anyone lands on this page..

when loading the content:
Code: [ Select ]
cleanTextFunc(x.childNodes[i].childNodes[0].firstChild);


and creating the cleanTextFunc:

Code: [ Select ]
cleanTextFunc = function (txt) {
txt = txt.toString();
txt = txt.split("'").join("‘");
txt = txt.split('"').join('”');
return txt;
};
  1. cleanTextFunc = function (txt) {
  2. txt = txt.toString();
  3. txt = txt.split("'").join("‘");
  4. txt = txt.split('"').join('”');
  5. return txt;
  6. };



Have a nice day!
  • vinid3
  • Novice
  • Novice
  • vinid3
  • Posts: 17

Post 3+ Months Ago

Oh! Just found out the clean way of doing!

add: .nodeValue at the end to get the exact content of the node.. with ",',& and everything

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 18 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.