Skip to main content
Participant
August 18, 2008
Question

Page Encoding Issues

  • August 18, 2008
  • 4 replies
  • 707 views
I seem to be having a problem with CFMX 7.0.2. We have some pages which contain French text. When you view these pages in your browser the character encoding is completely garbled. I've tried forcing the character set through the .CFM file itself but it still garbles the text. I've checked the browser settings, and i've even checked the file encoding. I'm at a loss, i've tried the same files on another server running CFMX 7.0.2 and it's experiencing the exact same thing.

Any help/ideas are greatly appreciated.
    This topic has been closed for replies.

    4 replies

    BKBK
    Community Expert
    Community Expert
    September 7, 2008
    It's clear. As we're still in the process of elimination, why not do the obvious. Set the page up as I've done, and do a round-trip using something like the following

    <cfif isDefined("form.txtSample")>
    <!--- code to save sample text to file goes here --->
    Output of text sample: <cfoutput>#form.txtSample#</cfoutput>
    </cfif>
    <cfform action="#cgi.script_name#" method="post">
    Text sample: <cftextarea name="txtSample">é and à</cftextarea>
    <cfinput type="submit" name="sbmt" value="save to file">
    </cfform>

    Inspiring
    September 7, 2008
    BKBK wrote:
    > <cfcontent type="text/html; charset=utf-8">
    > <cfscript>
    > SetEncoding("form", "utf-8");
    > SetEncoding("url", "utf-8");
    > </cfscript>

    he says his db's (oracle) encoding is latin-1. he's said, cfprocessingdirective
    etc. have no effect.
    BKBK
    Community Expert
    Community Expert
    September 7, 2008
    Warbucks81 wrote:
    When you click submit, it writes the text to a file. Now if I enter the following characters (these are the characters im having issues with) "é" and "à", I end up getting "?" in the file.

    Does it help when you add the following code before the form? (preferably at the top of the page)

    <cfcontent type="text/html; charset=utf-8">
    <cfscript>
    SetEncoding("form", "utf-8");
    SetEncoding("url", "utf-8");
    </cfscript>




    Inspiring
    August 18, 2008
    Warbucks81 wrote:
    > Any help/ideas are greatly appreciated.

    where's the text coming from? what encoding? can you provide a simple example
    showing the problem?

    Participant
    September 2, 2008
    Hi Paul,

    Sorry for the late response, I was away on holidays for a bit. We run an in house content management system for our websites. A user creates/edits a page which falls under "draft" in our system. The draft is sent to the publisher who then publishes the page and makes it "live". Our character encoding issues happen once the text is saved to the database. Once the developer/editor saves their draft, it gets stored in the DB(we run oracle) and that is where the character encoding (french text in this case) ends up garbled.

    I've checked the default encoding of the oracle db and it's set to ISO-8559-1. I've also double checked to ensure the coldfusion code isn't causing the issue when it saves to the database.

    Again, any help is appreciated.

    Thanks,