7 Replies Latest reply on May 7, 2007 8:29 AM by Rothrock

    Foreign Characters in Dynamic TextFields

    ropeGun Level 1
      I am reading in an XML file that contains some Swedish vowels (åäö) which I then load into some dynamic text fields at runtime. How do I get these to show up in the text field? I have tried rendering my text as HTML and wrapped the text in "<![CDATA[" and "[[>" tags within the XML file, and used the "&ouml;" html character, but nothing works.

      I have also embedded all characters of a font family which I know contains these characters, but to no avail.

      (BTW) &ouml; = ö, for example.

      What is the trcik?

        • 1. Re: Foreign Characters in Dynamic TextFields
          JHolmqvist
          I just tried it because I'm also making a site with xml in swedish, but I had no problems...
          The only thing I can think of is possibly the first row in your xml, what does it say? Do you use an encoding that supports swedish characters? Mine is:
          <?xml version="1.0" encoding="UTF-8" ?>
          • 2. Re: Foreign Characters in Dynamic TextFields
            Rothrock Level 5
            The trick is to be sure and save the XML/text file as UTF-8. Then you won't even need the unescaped or html codes.

            Just adding the tag shown by JHolmqvist isn't enough, you need to make sure that your text editor/XML source supports UTF-8.
            • 3. Re: Foreign Characters in Dynamic TextFields
              ropeGun Level 1
              I have tried this and it still doesn't work. The only difference (that I can see) is that my header on the XML file is:

              <?xml version="1.0" encoding="utf-8" standalone="yes"?>

              I use TextPad to save the file in UTF-8 format. I just can't see what else it could be...

              JHolmqvist, could you send me one of your XML files that works (if it is not sensitive, of course) to see if it works if I send it through my SWF?

              -john
              • 4. Re: Foreign Characters in Dynamic TextFields
                Rothrock Level 5
                If you can do this in the testing environment, go to the Debug menu and List Variables after the XML file has loaded. Do you see them correctly in the XML object there?

                Can you post a link or a URL for a (short) version of the problem XML file?
                • 5. Re: Foreign Characters in Dynamic TextFields
                  ropeGun Level 1
                  Hooo-yeah!

                  I got this to work -- finally! I should have been more systematic in my testing.

                  I had been embedding (using the "Embed..." button within the Dynamic Text properties) all of the regular English letters/numbers/punctuation and "Basic Latin" character sets which was not enough. The ÅÄÖ letters appear in the "Latin I" character set.

                  Anyway, the important steps for getting non-English standard characters into a dynamic field at run-time (sourced from an XML file) are as follows:

                  1. XML files must have the header: <?xml version="1.0" encoding="UTF-8"?>
                  2. The text editor used for creating the XML files must support and save the UTF-8 format.
                  3. You must either choose the correct character sets to embed into the dynamic text field under its properties or use the "Include these characters:" setting.
                  4. It is not necessary to render the dynamic text field as HTML or use the <![CDDATA[[ ]]> tags.

                  Thanks once again for the help that I have recieved from this wonderful forum -- it's fanatastic to be able to pick the brains of geniuses so easily!

                  -john
                  • 6. Re: Foreign Characters in Dynamic TextFields
                    ropeGun Level 1
                    Hooo-yeah!

                    I got this to work -- finally! I should have been more systematic in my testing.

                    I had been embedding (using the "Embed..." button within the Dynamic Text properties) all of the regular English letters/numbers/punctuation and "Basic Latin" character sets which was not enough. The ÅÄÖ letters appear in the "Latin I" character set.

                    Anyway, the important steps for getting non-English standard characters into a dynamic field at run-time (sourced from an XML file) are as follows:

                    1. XML files must have the header: <?xml version="1.0" encoding="UTF-8"?>
                    2. The text editor used for creating the XML files must support and save the UTF-8 format.
                    3. You must either choose the correct character sets to embed into the dynamic text field under its properties or use the "Include these characters:" setting.
                    4. It is not necessary to render the dynamic text field as HTML or use the <![CDDATA[[ ]]> tags.

                    Thanks once again for the help that I have recieved from this wonderful forum -- it's fanatastic to be able to pick the brains of geniuses so easily!

                    -john
                    • 7. Re: Foreign Characters in Dynamic TextFields
                      Rothrock Level 5
                      Glad you got this to work for you. I'm not sure about step number 1. I've done a lot of this and never needed to have that header.

                      The rest I will agree with. Although if you will be doing extend blocks of text I would recommend learning how to use CDATA because it comes in very handy.