21282 Posts in 5730 Topics by 2601 members
|Go to End|
27 November 2009 at 2:30am Last edited: 27 November 2009 2:31am
I have a strange problem just in IE7. German umlauts (Ã¶Ã¤Ã¼) do not appear correctly. This problem appears only with my custom silverstripe input fields for page content. Normal page content is shown correctly... there umlauts appear in the database as html-code like ä [=Ã¤]
Can I somehow tell my input fields to convert umlauts to html-coded characters similar to the standard content text input seems to do it?
And one additional question: why is the silverstripe database encoded latin1-swedisch? I guess utf8 could solve the umlauts problems. I also tried this to change the collation manually in the database to utf8, but the Strings somehow arrive wrong in the database.
Thanks for your help,
27 November 2009 at 5:29am
you need to do some research on a topic called character encoding / character decoding.
I'll give you some hints, which will get you going:
If I type something here, my editor or browser has set a character encoding. Lets say utf-8. Now you store it to your database. Most people do not know, which character encoding there database is actually using. MySQL for example uses latin 1 per default. So it could be that your transmitted data is stored in latin 1 instead of your original encoding. Next step is when you want to pick up the data again from your database to display it somewhere. It could be that your database delievers the data in a different encoding than it uses to store it... Not to mention the client i. e. webbrowser, which will show it up again. Do you know, it is using utf-8, latin1 or whatever to show what it has got to display?
You can only solve this, if you know exactly what is going on and where it is happening. Every step can be configured or manipulated. Google provides a lot of stuff on that issue.
Hope this helps.
3 December 2009 at 1:23am
thanks for your answer. I tried so input the data with a different browser (Safari)... then suddenly the data arrived correctly in the database...
3 December 2009 at 5:14pm
one other thing to check is if your ss templates are encoded in utf-8. its usually a setting in the authoring software (notepad++, dreamweaver, whatever you are using). I know that makes a difference for the translated static text stored in the lookup tables like mysite/lang/en_US.php, but not sure if it makes a difference with content from the database. its normal to see the translated umlauts in the database.
hope it helps,
26 December 2009 at 5:55am Last edited: 26 December 2009 5:55am
it finally helped to include the meta tag to the head of the main page.ss template file:
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
|Go to Top|