Home
TeamSite
Teamsite UTF-8 Encoding problem
grunners
Hi,
We've recently upgraded from Teamsite 5.5 to Teamsite 6.1
Our pages are now having issues displaying UTF-8 characters, as they are encoded ISO-8859-1.
This is not an issue until the pages are changed - on preview, the UTF-8 characters don't display properly.
For example,
“GO LIVE” will be fine until someone changes the page. On change, it is displayed as “GO LIVEâ€�
I have attempted a workaround in PERL to encode all text as ISO-8859-1, as follows.
$text = Encode::encode("ISO-8859-1", $text);
This simply displays ?GO LIVE?
Any suggestions?
Thanks,
David Grunstein
Find more posts tagged with
Comments
fjvelasco
Hi
FormsPublisher uses UTF-8 as default encoding. The DCRs are UTF-8 and the output pages too. To change the output encoding, edit /iw-home/local/config/iwpt_encoding.ipl and modify the value of the "return" from "utf-8" to your output encoding "ISO-8859-1". Also, in the TPL, write as the first line:
<?xml version="1.0" encoding="ISO-8859-1"?>
And output to the HTML page the META:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
This works for me and my language is Spanish.
Is it helpfull for you?
Regards.
FJ
grunners
Muchas gracias.
That's a pretty good solution.
fjvelasco
Hi
I forgive another tag. If you have a server like Apache or Tomcat for JSP, perhaps you need to add to your pages another especific tag to tell to that servers how to parse the content. I worked with Apache and Tomcat and the JSPs need to declare their encoding in order to don't obtain a Java Exception Error.
Good luck.
Thanks.
FJ
zyggie04
I'm confronted with same lousy behavior and have attempted your "fix" - it looked promising. So it partially works in that:
- the dcr (declared as ISO-8859-1) accepts accents in the UI (TS 6.1)
- once saved, the resulting DCR xml file holds the accented material as double-byte (but has a declaration of UTF-8 : outside my control, for now)
- once merged with a PTL defined as ISO-8859-1, gives a properly encoded HTML that displays properly in the browser.
_BUT_
if the user edits the DCR, the edit form shows screen garbage (ie.: é for every 'é' in the original text - and it makes somewhat sense since it was held that way in the xml and the edit mechanism picked it up and accordingly stuffed the input fields with it).
now, the user adds some text, or adds a replicant item, fills it up with french - possibly accented - text, saves the DCR, and on next generation (merge with PTL), the newly entered material show ok, BUT THE PREVIOUSLY EXISTING MATERIAL COMES UP AS 'é' garbled, because that's the way it was saved.
This really is eating at me now; how can this supposedly flexible encoding process work, if one of the steps (the DCR edition in TEamsite's UI) is ALWAYS restricted to UTF-8 scheme no matter what?
Any suggestions on the workaround/troubleshooting avenue(s) I should consider?
Many thanks.
bboyle
We are using TeamSite 5.5.2, using UTF-8 for all DCRs and the presentation templates (TPL files) themselves, but all output HTML is generated in ISO-8859-1.
Here's what we've done:
1. We have modified iw-home/local/config/iwpt_encoding.ipl to always return ISO-8859-1.
2. DCRs are stored in UTF-8.
3. Presentation templates are UTF-8 (the actual *.tpl files), but specify the output encoding as ISO-8859-1.
<?xml version="1.0" encoding="UTF-8"?>
<iw_pt encoding="ISO-8859-1"> ... </iw_pt>
The encoding in the XML prolog specifies the encoding of the XML file (the tpl file). I don't believe this can be used to indicate the desired encoding for output.
The iw_pt tag has an encoding attribute, this IS used to indicate the desired encoding for output.
4. Generated files are encodined in ISO-8859-1.
Hope it helps!
ela
I have exactly the same config as you, except for the iw-pt part. Here's a sample from one of my pt's:
<?xml version="1.0" encoding="UTF-8"?>
<iw_pt name="Standard Presentation Template">
<META content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
The META information is meant for the user's browser to interpret in the right encoding.
In the iw-home/local/config/iwpt_encoding.ipl I also always return ISO-8859-1:
# Default policy
return 'ISO-8859-1';
This works for German, French, Italian characters.
TS 5.5.2 Solaris
Webserver: BEA Weblogic