3 Replies Latest reply on Aug 22, 2007 9:39 AM by Newsgroup_User

    Foreign Fonts in dynamic XML

    skyhead03
      I'm working on a learning language app, so far, that teaches Thai to English speakers and English to Thai speakers. I'm pulling lesson words from an access database that is storing foreign characters just fine. Here is the xml page for the first lesson of eng/thai - http://www.netspeaknow.com/getlessonwords1.cfm and code:
      <cfquery name="getLastLessonID" datasource="langDB">
      SELECT lastLessonID
      FROM Users
      WHERE userID = 1
      </cfquery>
      <cfif #getLastLessonID.RecordCount# EQ 1>
      <cfquery name="getLessonWords" datasource="langDB">
      SELECT LessonMP3.filePath, LessonWords.displayWord, LessonWords.phonetic, LessonWords.definition
      FROM LessonWords INNER JOIN LessonMP3 ON LessonWords.sndID = LessonMP3.sndID
      where lessonPlanID = 18
      </cfquery>
      </cfif>
      <cfcontent type="text/xml" reset="yes">
      <cfsetting showdebugoutput="No" enablecfoutputonly="Yes">
      <?xml version="1.0" encoding="UTF-8"?>
      <cfoutput>

      <results_packet>
      <cfloop query="getLessonWords">
      <rec displayword="#displayWord# - #phonetic# /#definition#" sndurl="#filePath#" />
      </cfloop>
      </results_packet>
      </cfoutput>

      Here's the error I'm get trying create the same document with Thai characters.
      http://www.netspeaknow.com/getlessonwords2.cfm

      I don't have any problem displaying foreign characters in my browser:
      Here's a page that is pulling the same data for the same thai/eng lesson.
      http://www.netspeaknow.com/lessonview_thai.cfm

      Does anyone know how I can get foreign characters, not just Thai, into my XML document?
        • 1. Re: Foreign Fonts in dynamic XML
          Level 7
          skyhead03 wrote:
          > <cfcontent type="text/xml" reset="yes">
          > <cfsetting showdebugoutput="No" enablecfoutputonly="Yes">

          enablecfoutputonly="Yes", you need to wrap *all* the xml output in a cfoutput,
          no xml header/root is getting sent to the browser which is probably what "XML
          Parsing Error: not well-formed" is all about. try this:

          > <cfoutput>
          <?xml version="1.0" encoding="UTF-8"?>
          > <results_packet>
          > <cfloop query="getLessonWords">
          > <rec displayword="#displayWord# - #phonetic# /#definition#"
          > sndurl="#filePath#" />
          > </cfloop>
          > </results_packet>
          > </cfoutput>
          >

          > Here's a page that is pulling the same data for the same thai/eng lesson.
          > http://www.netspeaknow.com/lessonview_thai.cfm

          that page is lying:
          <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
          might indicate other encoding problems lying in wait for you.

          > Does anyone know how I can get foreign characters, not just Thai, into my XML
          > document?

          "just use unicode"

          • 2. Foreign Fonts in dynamic XML
            skyhead03 Level 1
            Thanks for responding.
            When I place <?xml version="1.0" encoding="UTF-8"?> inside the cfoutput tags I get another error: XML Parsing Error: xml declaration not at start of external entity
            as you can see for your self here: http://www.netspeaknow.com/getlessonwords3.cfm
            The way I originally had it, the error looked like it had to do with a foreign character(?)
            http://www.netspeaknow.com/getlessonwords2.cfm

            As far as "use unicode" , I'm not sure what that means. My database is using the unicode driver for Access. Should I be using a unicode font like Ariel Unicode MS in my xml document?
            • 3. Re: Foreign Fonts in dynamic XML
              Level 7
              skyhead03 wrote:
              > http://www.netspeaknow.com/getlessonwords2.cfm

              can you save the xml to a file & either send it to me or attach to this thread?

              > As far as "use unicode" , I'm not sure what that means. My database is using
              > the unicode driver for Access. Should I be using a unicode font like Ariel
              > Unicode MS in my xml document?

              you're not using unicode everywhere, as i pointed out that HTML page has
              incorrect encoding hinting, maybe other cases in your website. "just use
              unicode" also means use unicode everywhere.

              no the font has nothing to do w/xml, only the browser display.