Tuesday, January 16, 2007

Hyundai Camera Driver

Custom character sets in the backend

So after I've spent a good five hours to find out why the website of a customer shot so Sun has been shown (only in Japanese language version), you get the solution of quasi served on a silver platter.
First off my problem description: Our client supplied
Japanese texts (web site exists in German [Standard], English and Chinese [Simplified]). After our intern entered the majority of Japanese texts is then had noticed that for some sign of HTML code will be destroyed.
have for eternal back and forth, I then found that the Japanese character ( csh_jp [yes, the TYPO3 version is not 4.0]) set for the Japanese language pack with shift_jis not compatible with the customer-supplied Word documents was (who were in the character set euc-jp encoded ).
Now one could argue, "Why did not you forceCharset in the Install Tool to set UTF-8 Then the problem would not exist ...?"
My answer: "Sure - absolutely thoughtful response, but no one was so real keen on the customer his German texts explain why all must be entered again. And ... oh yeah I had mentioned - since even a Chinese version was ... "
Conclusion: We have to somehow convert the BE in euc-jp (yes the VU is relatively simple to switch)

The bad news first. except forceCharset the encoding in the backend can not override
Now the good. too hard it still is not - if you know where you even need ...

solution:

You open the file typo3 . / t3lib/class.t3lib_cs.php
approximately in line 356 is the following code:
 var $ lang_to_charset_unix = array (
'west_european' => 'iso-8859-1',
'estonian' => 'iso-8859-1',
[...]
'chinese' => 'gb2312' / / = euc-cn
'japanese' => 'euc-jp '
'korean' => 'euc-kr',
[...]
);

The next array is the same for Windows, just that there is a charset for Japanese shift_jis . This has to be euc-jp be replaced. Last you need in the next array ($ charSetArray ), ticker jp euc-jp also be registered. Now you have to
only upload the file and voila - your back shines with new coding.

Oh, and for front-end's in your TypoScript template you must insert the following line:
 config.renderCharset = euc-jp 

I hope you saved a lot of time.

0 comments:

Post a Comment