Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Getting Started / December 2005



Tip: Looking for answers? Try searching our database.

loosing latin characters

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Telemedianer - 29 Dec 2005 10:55 GMT
hi, we are in the process of upgrading from cf5 to cfmx7 on linux. i am
experiencing problems with lating characters (umlaute for example). the
Webserver's (Apache 2.0) default encoding is ISO-8859-1 the following simple
HTML page shows as expected:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Untitled</title>
</head><body>
???
</body></html>

the umlaute (???) are dispalyed propperly, the server sends a "Content-type:
text/html; charset=iso-8859-1" repsonse header.

if i rename the same example from test.html to test cfm and serve it trough
cfmx7 updater3 i get the following response:

... some headers ...
Content-Type: text/html; charset=UTF-8

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Titel ...</title>
</head><body>
???
</body></html>

makes sense to me that the characters cannot be displayed propperly. So then i
have added a <cfheader name="Content-Type" value="text/html"
charset="ISO-8859-1"> to the top of the cfm page and tried again:

this is the response i got:
HTTP/1.x 200 OK
Date: Thu, 29 Dec 2005 10:49:55 GMT
Server: Apache/2.0.49 (Linux/SuSE)
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=ISO-8859-1

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Untitled</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-5589-1">
</head><body>
???
</body></html>

i do not understand why the characters are displayed that way now. the file
(test.cfm) is defenately not stored as utf-8 file since i do not use an editor
which would support it. i belive that coldfusion is somewhat translating the
content (getting data from db works fine with unicode support and the mentioned
charset, however updating will fail and translate the characters again).

is there a way around this behavour ?

Cheers,
-Simon
PaulH *TMM* - 29 Dec 2005 11:27 GMT
>  i do not understand why the characters are displayed that way now. the file

the default encoding for cf 6 & above is utf-8. first, are the chars you
want to display in iso-8859-1 or are you really using a windows codepage
(cp1252 for example)? i'm not sure what you're asking for but for
individual pages try adding

<cfprocessingdirective pageencoding="ISO-8859-1"/>

to the top of each page. or if you want the whole server to behave that
way change the defaultCharset value in cf_root/lib/neo-runtime.xml file:

<var name='defaultCharset'><string>UTF-8</string></var>

to whatever encoding you want to use.
Telemedianer - 29 Dec 2005 12:38 GMT
Paul,

thank you adding <cfprocessingdirective pageencoding="ISO-8859-1"/> to my Application.cfm did the trick! Now the app works in cfmx7 as it did in cf5.

Cheers,
Simon
PaulH *TMM* - 29 Dec 2005 17:40 GMT
> thank you adding <cfprocessingdirective pageencoding="ISO-8859-1"/>
> to my Application.cfm did the trick! Now the app works in cfmx7 as it
> did in cf5.

no it doesn't. that's a compile time tag, it needs to be on every page.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.