Affects Version/s: 6.1.1 CE GA2, 6.1.2 CE GA3, 6.1.20 EE GA2, 6.1.30 EE GA3, 6.2.0 CE RC4, 6.2.0 CE GA1, 6.2.10 EE GA1
- JDK-1.7.0_45 64-bit
- Ubuntu 12.04 LTS 64-bit
- Portal master 493ec808fb46ca4decb9bdc3592f1b01e4f3170e
0- Start potal with JDK 7/JDK 8
1- Deploy language-hook-18.104.22.168.war
2- Go to Admins/Content
3- Switch language to "hu"
Title of "Documents and Media" should be "ékezet"
Title of "Documents and Media" should be "�kezet"
=== Technical background
It can be a common coding policy at our customers that prohibits to use special characters in properties files.
1- Create a language-hook (use https://github.com/lipusz/liferay-plugins/tree/LPS-41178-sample-language-hook)
2- This hook contains a file called Language_ext_hu.properties
3- This file originally contained
then, it was converted to ASCII/Unicode by "native2ascii", so now contains UNICODE characters. Result is the same if you save it in UTF-8.
4- HookHotDeployListener#initLanguageProperties calls
5- Using JDK 7/JDK 8, it will fallback to
that executes an encode-decode logic on every key-value pairs.
6- Calling an encode-decode on a UNICODE sequence will produce such incorrect values.
7- You can also test it by running the simple tester.jar
Cannot be reproduce on JDK 6, as "loadJDK6(Reader reader)" uses UTF-8 to encode.
=== Alternative way to reproduce
1- Modify Language_hu.props in portal-impl/src/content/ similarly to the hook
2- Execute "ant deploy" from "portal-impl" to deploy the changes to your server
3- Repeat the steps above