Charset of $customerData fields

Use this forum for questions regarding adoption and functionality of OpenEMM

Moderator: moderator

IL
Posts: 4
Joined: Tue Dec 19, 2006 4:31 pm
Location: Berlin

Charset of $customerData fields

Post by IL »

I'm having problems using umlauts in a form field. If I am storing data containing an umlaut using the following form:

Code: Select all

<form action="form.do" method="post">
<input type="hidden" name="agnCI" value="1">
<input type="hidden" name="agnFN" value="Save">
<input type="hidden" name="agnUID" value="$agnUID">
Vorname: <input type="text" value="$customerData.firstname" name="firstname">
<br/>
<input type="submit" value="submit!">
</form>
I can see the umlaut is stored correctly inside the database, i.e. I can see it inside the admin->recipient view. But if I'm using the same form to view the field it is displayed in the wrong charset. The charset of the fields is always iso-8859-1. If I change my form to contain a

Code: Select all

<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
meta-tag I can view the field correctly, but I can't save it anymore. The values are not stored.

It seems as if I have to be in utf-8 to store fields and to be in iso-8859-1 to display fields...

Is there a known workaround?
IL
Posts: 4
Joined: Tue Dec 19, 2006 4:31 pm
Location: Berlin

Charset of $customerData fields

Post by IL »

I had to change line 83 in UserFormExecuteAction.java to get the correct charset encoding. Old line:

Code: Select all

String responseMimetype=new String("text/html");
My new line is:

Code: Select all

String responseMimetype=new String("text/html; charset=utf-8");
I'm not sure if this is a fix or a workaround. Using the new line means you have to use utf-8 encoding inside your forms.
Post Reply