Coldfusion server not displaying accents correctly

Posted on 2009-04-28
Last Modified: 2013-12-24
I have a .cfm page/form with french words that have accents.  When displayed in any browser the accents don't display correctly.  If I change the extension from .cfm to .html and serve the page from the same directory the accents appear just fine (but the form is worthless).  It seems like there needs to be some configuration on the server side but I haven't found what that might be.  Is there config that needs to be done on the server side to get coldfusion to display accents correctly and what would it be?

Everything I've been able to find is that you need to use utf encoding in the page which I am but doesn't seem to matter to coldfusion
Code snippet:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="">


<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Session 2</title></head>


<!---the "action" attribute has the form submit the information to this page (or itself), where the <cfif isdefined("form.submit")> tag takes over, processing the form data--->

<cfform id="form1" name="form1" method="post" action="session_2.cfm">

  <p align="center"><strong>Session 2</strong></p>



    <!--- below is where the validation takes place, there is the required directive and then the message to display if a selection has not been made.  This needs to be coded for every field in the form--->

    <cfinput type="text" name="prenom" id="prenom"

     required = "Yes"

      message = "Please enter a prénom"  />




  <cfinput type="text" name="nom" id="nom" 

   required = "Yes"

      message = "Please enter a nom"  />


  Numéro de 4 chiffres  </p>

  <p><strong>A  Composition</strong></p>

  <p>Votre meilleur(e) ami(e) vient de vous envoyer ce courriel:</p>

  <p>I decided to leave for China tomorrow morning! I'm not taking anything with me, I don't have any money, I don't speak Chinese and it's the first time I'm going on a trip. I know it sounds crazy but I cannot stand my parents anymore, especially my mother. She drives me crazy and I hate my step-father! So, I'm leaving morning and I don't know when I'll come back. Adieu!</p>

  <p>Empêchez votre ami(e) de commettre cette énorme erreur. Conseillez-le/la en lui écrivant une lettre (en anglais bien sûr) avec un minimum de 15 verbes ou expressions verbales différents. Cliquez dans l'espace ci-dessous pour commencer à écrire.</p>



    <cftextarea name="composition" id="composition" cols="80" rows="25" required="yes" message="Please enter a composition"></cftextarea>




  <p><strong>B  Complétez les phrases </strong></p>

  <p>Complétez les phrases suivantes en choisissant la forme correcte du verbe pour que la phrase soit logique et grammaticale. </p>



Open in new window

Question by:mwbry
    LVL 27

    Accepted Solution

    which cf version are you on?
    which db? which version? if it is ms access - are you using Access with Unicode driver in your cf dsn setup?
    are the accented characters that do not display properly coming from your db, or are they plain-text in the page?

    cf versions after 5 all use utf-8 as default page encoding. but your tables and db driver also have to use utf-8 charset/collation.

    if you are using Application.cfm, include the following code in it:
    <cfcontent type="text/html; charset=utf-8">

    (if you are using Application.cfc, include similar code in onRequestStart() method)

    you may also need to include <cfprocessingdirective pageencoding="utf-8"> at the top of every page in your site...

    but i would start with making sure your db and cf 'speak the same language' - use the same charset and encoding (utf-8)


    Author Comment

    I am using Coldfusion 7.  There is no database involved in this application.  The form data writes a .txt file back to the directory from which the .cfm form is served so it's not an issue of displaying or writing data from or to a database.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
    When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now