Skip to main content
Inspiring
June 1, 2011
Question

Can anyone explain this problem with the CF server ?

  • June 1, 2011
  • 3 replies
  • 1550 views

I posted it originally in the Dreamweaver forum thinking it was a problem with the application. They say differently.

http://forums.adobe.com/message/3713268#3713268

    This topic has been closed for replies.

    3 replies

    Big Mad Kev
    Participating Frequently
    June 2, 2011

    If you go into CFADMIN (/CFIDE/administrator) click Settings Summary

    You'll see Java File Encoding this will tell you what the default encoding is.

    Now as Andy says you can put that on the top of every page, (IIRC you can't do it in Application.cfm it has to be the top of the actual file)

    Or if you have access to edit your JVM config you can add this:

    -Dfile.encoding=utf8

    We've done this with success, and no need of using the processing directive.

    HTH

    More info about CF and UTF but it's quite old is here: http://www.thickpaddy.com/2009/8/10/coldfusion-is-not-utf-8-encoded

    Community Expert
    June 2, 2011

    Everyone who's answered so far is on the right track, but I think there's one extra little twist. I suspect that you're copying ISO-8859-1 content and CF is trying to serve it as UTF-8. I believe UTF-8 is the default encoding for modern versions of CF. So, you might have to specify the region-specific encoding you're copying from (again, I suspect ISO-8859-1) instead of UTF-8.

    As for why you're having this problem, it's not Dreamweaver's fault, or Word's fault, or CF's fault. It's the fact that you can specify different encodings every step of the way, and there's no automatic way for the computer to infer what you really want to use.

    Read this:

    http://www.joelonsoftware.com/articles/Unicode.html

    Dave Watts, CTO, Fig Leaf Software

    http://www.figleaf.com/

    http://training.figleaf.com/

    Dave Watts, Eidolon LLC
    Participating Frequently
    June 1, 2011

    <cfprocessingdirective pageencoding="utf-8">

    Andy

    Inspiring
    June 1, 2011

    To expand slightly on what Andy says, if you have anything other than just ASCII in a CFM template, you need to tell the CF compiler.  And that's what that directive does: it tells the CF compiler than the file is UTF-8, not just ASCII.  Read the docs on it though.

    --

    Adam

    Inspiring
    June 1, 2011

    So, not wanting to use that directive, I need to find a way to get from MS Word into Dreamweaver, and ensure the contents of the code are ascii only.

    So why doesn't Dreamweaver perform a conversion of incoming non-ascii text to ascii ?