I have got the following main Controller default action in fw/1 (framework one 4.2), where i define some rc scope variables to be displayed in views/main/default.cfm.
main.cfc
function default( struct rc ) {
rc.name="ΡΨΩΓΔ";
rc.dupl_name="üößä";
}
views/main/default.cfm
<cfoutput>
<p> #rc.name# </p>
<p> #rc.dupl_name# </p>
</cfoutput>
and finally in layouts/default.cfm
<cfoutput><!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
A Simple FW/1 Layout Template
</title>
</head>
<body>
#body#
</body>
</html>
</cfoutput>
Unfortunately i receive the following output
ΡΨΩΓΔ
üößä
Any idea that could help me?
Regards
Because I already gave you a solution within my comments, I’m posting it as an answer here, so that others with similar issues may find the root of their charset issues.
The issue described above is very often the result of conflicting charset encodings. For example, if you are reading an ISO-8859-1 encoded file and outputting it with UTF8 without having them converted (de-/encoded) properly.
For the purpose of sending characters through a webapp as you are doing, the most common charset encoding as of today is UTF-8.
All you need to do is to harmonize characterset encodings or at least ensure that the encodings are set in such a manner that the processing engine is able to encode and decode the charsets correctly. What you can do in your case is:
Note: That charset doesn’t always have to be UTF-8 (UTF-8 might use multiple bytes for certain characters). There may be use cases you would achieve the same result with single byte encodings, such as ISO-8559-1, that would also need less computing ressources and less payload.
I hope this may help others with similar issues.