Professional Web Applications Themes

cfinclude doesn't follow cht settings - Coldfusion - Advanced Techniques

I've been searching for a while, but this is something I don't fully understand. Compare http://www.fuifpunt.be/html/wiezijnwe.html The first one includes the second one via cfinclude. Cht ISO-8859-1 is set everywhere I can. The coldfusion doentation says: If you use the tag on a page that includes other pages by using the cfinclude or cfmodule tags, custom tag invocation, and so on, the tag has no effect on the included pages. How can I force the special characters to be shown correctly? Thanks a lot, Pieter...

  1. #1

    Default cfinclude doesn't follow cht settings

    I've been searching for a while, but this is something I don't fully understand.

    Compare http://www.fuifpunt.be/html/wiezijnwe.html

    The first one includes the second one via cfinclude. Cht ISO-8859-1 is set
    everywhere I can.

    The coldfusion doentation says: If you use the tag on a page that includes
    other pages by using the cfinclude or cfmodule tags, custom tag invocation, and
    so on, the tag has no effect on the included pages.

    How can I force the special characters to be shown correctly?

    Thanks a lot,
    Pieter

    JwnPieter Guest

  2. #2

    Default Re: cfinclude doesn't follow cht settings

    Cht ISO-8859-1 is set everywhere I can. (Coldfusion MX 7)

    Either use Unicode,
    <meta http-equiv="content-type" content="text/html; cht=utf-8">
    or, perhaps even better, delete all your encoding tags! The default
    encoding in Coldfusion MX7 is Unicode already.

    BKBK Guest

  3. #3

    Default Re: cfinclude doesn't follow cht settings

    Conversion of all site data to utf-8 isn't really an option, because it doesn't
    concern 1 site. It concerns a whole bunch of sites (, that use Coldfusion, on
    the same server).

    All of the data is in ISO-8859-1 already.
    *frustrated mode* What's the point of having options to set another character
    set if it doesn't work 100% and the only solution seems to be conversion to the
    standard supported utf-8 ???

    I hope somebody can help me (us) out...

    JwnPieter Guest

  4. #4

    Default Re: cfinclude doesn't follow cht settings

    JwnPieter wrote: 

    what special chars? a casual glance at those pages shows the 1st page w/
    ýýýý, is that what you meant? if not, what exactly is the problem?

    what 'encoding' tags are you using? setEncoding? cfcontent? any of those
    files have a BOM? what encoding did you use to create the included page?
    there's nothing on that page to indicate anything about encoding--a bad
    practice.

    is this your server? if so you can force cf to use latin-1 as its
    default server-wide encoding by editing the defaultCht value in
    cf_root/lib/neo-runtime.xml file, though you might not like the
    side-effects long term.

    that meta header has no effect on cf.
    PaulH Guest

  5. #5

    Default Re: cfinclude doesn't follow cht settings

    Data encoded in ISO-8859-1 can be shown in Unicode. The reverse is not
    necessarily true. That is why using Unicode will save you some headache.

    You don't have to go around, converting the encoding on all the sites. Why not
    do so on just the sites that you have access to?
    http://tutorial255.easycfm.com/ might help.

    BKBK Guest

  6. #6

    Default Re: cfinclude doesn't follow cht settings

    I'm sorry if I wasn't clear enough.

    Characters as &eacute; and some spaces are not shown as they shoud.

    And yes, it's my server. Here are the changes i made already:

    In cf_root/lib/neo-runtime.xml:
    defaultCht value changed from UTF-8 to ISO-8859-1 (same value as the
    mailencoding cht value)

    All dsn's have the connection string option:
    useUnicode=true&characterEncoding=ISO-8859-1
    which ensures, together with the mysql settings, that Latin-1 specific
    characters ARE being saved and read correctly.

    JVM Arguments
    -server -Dsun.io.useCanonCaches=false -XX:MaxPermSize=128m
    -Dcoldfusion.rootDir={application.home}/
    -Dcoldfusion.libPath={application.home}/lib -Duser.language=nl -Duser.region=BE
    -Dfile.encoding=ISO-8859-1

    Via Application.cfm, at the start of every coldfusion page:
    <cfprocessingdirective pageencoding="iso-8859-1">
    <cfcontent type="text/html; cht=iso-8859-1">
    <cfscript>
    SetEncoding("form", "iso-8859-1");
    SetEncoding("url", "iso-8859-1");
    </cfscript>

    With every cffile tag (in the scripts) (except for action="delete"):
    cht="iso-8859-1"


    to PaulH *TMM*:
    What do you mean if you say that nothing on that page indicates anything about
    the encoding?
    What long term side effects are you talking about?

    Thanks for helping me to point those things out.

    JwnPieter Guest

  7. #7

    Default Re: cfinclude doesn't follow cht settings

    JwnPieter wrote: 

    spaces? is there some kind of "special" space char in the dutch (i guess
    that's the language) you're using (maybe coming out of a word
    processor)? in thai (windows-874) there is (char #160) & it shows up as
    an ugly á when viewed on pages not tagged w/thai codepage. if dutch has
    one, it means your encoding is out of synch someplace along the line.
     

    cfprocessingdirective can't be in application.cfm (or CFC), only works
    on cf pages. it works at compile time.
     

    i mean there's *nothing* on that html page indicating *any* encoding.
    you *always* have to provide some kind of encoding hint. you cannot
    forensically determine encoding--not reliably anyway.
     

    not using unicode means bigger problems down the road when you want to
    move out into a wider market--and before you saw "never", i bet you a
    beer you will eventually. re-doing the db, the code, etc. is gong to hurt.

    PaulH Guest

  8. #8

    Default Re: cfinclude doesn't follow cht settings

    <cfscript>
    SetEncoding("form", "iso-8859-1");
    SetEncoding("url", "iso-8859-1");
    </cfscript>
    This spells bad news. It instructs Coldfusion that all your users speak Latin.
     
    In my experience, nowadays developers who use non-Unicode encodings like
    iso-8859-1 do so only because they either are not aware of the problems that
    can cause, or are unable to change the settings. You seem to want to do it by
    choice. As the server is yours, why don't you just use Unicode and save
    yourself
    a headache?

    BKBK Guest

  9. #9

    Default Re: cfinclude doesn't follow cht settings

    Apperently, if you cfinclude a html file, there's no way you can explicitely
    tell coldfusion which cht to use.
    I once read in the coldfusion doentation, that, in that case, coldfusion
    uses the server operating system default cht.
    Now, I don't wanna mess with that.

    If I want to use UTF-8, I have to convert all of my current websites data from
    ISO-8859-1 to UTF-8, right?
    (i'm not talking about 10 pages and 1 database, it concerns about 100
    databases and, i guess, thousands of files)
    (or) What's the procedure you recommend to convert everything as smooth as
    possible?
    What are the possible pitfalls?

    Thanks for your suggestions!

    JwnPieter Guest

Similar Threads

  1. CFINCLUDE
    By ArtNirvana in forum Macromedia ColdFusion
    Replies: 0
    Last Post: February 15th, 10:00 PM
  2. Replies: 5
    Last Post: December 1st, 12:05 PM
  3. ASPHTTP Doesn't Follow Redirects
    By B. Paluch in forum ASP Components
    Replies: 0
    Last Post: November 20th, 04:58 PM
  4. why doesn't filters preserve settings?
    By masimo in forum Adobe Photoshop Elements
    Replies: 2
    Last Post: July 13th, 10:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139