
|
If you were logged in you would be able to see more operations.
|
|
|
AppFuse
Created: 30/Jun/07 06:12 AM
Updated: 08/Oct/07 01:09 PM
|
|
| Component/s: |
i18n
|
| Affects Version/s: |
2.0-M5
|
| Fix Version/s: |
None
|
|
|
File Attachments:
|
None
|
|
Image Attachments:
|
|
|
Environment:
|
Windows 2000 Server (Simplified Chinese)
|
|
|
I've tried to generate a sample AppFuse 2.0-M5 project(type: appfuse-modular-struts), when I run it (command: mvn jetty:run-war), it displays Chinese characters incorrectly. I commented gzipFilter related mapping settings in src/main/webapp/WEB-INF/web.xml, there are still some incorrect characters(Refer to attachment 1).
I found the original displaytag_zh_CN.properties in appfuse-web-common-2.0-m5.war is wrong. I open it in notepad, it displays incorrect characters as I saw in my sample application. appfuse-web-common-2.0-m5-SNAPSHOT.war also contains displaytag_zh_CN.properties, I can view it correctly in notepad, but this file is not native2ascii'ed.
So I extract the file in appfuse-web-common-2.0-m5-SNAPSHOT.war, convert it from U8-UNIX to UNIX format by using UltraEdit, and use native2ascii trasfer it to LATIN-1 encoding, then add it into appfuse-web-common-2.0-m5.war and override the original one.
After that, I recreate my project and run it, it displays correctly.
|
|
Description
|
I've tried to generate a sample AppFuse 2.0-M5 project(type: appfuse-modular-struts), when I run it (command: mvn jetty:run-war), it displays Chinese characters incorrectly. I commented gzipFilter related mapping settings in src/main/webapp/WEB-INF/web.xml, there are still some incorrect characters(Refer to attachment 1).
I found the original displaytag_zh_CN.properties in appfuse-web-common-2.0-m5.war is wrong. I open it in notepad, it displays incorrect characters as I saw in my sample application. appfuse-web-common-2.0-m5-SNAPSHOT.war also contains displaytag_zh_CN.properties, I can view it correctly in notepad, but this file is not native2ascii'ed.
So I extract the file in appfuse-web-common-2.0-m5-SNAPSHOT.war, convert it from U8-UNIX to UNIX format by using UltraEdit, and use native2ascii trasfer it to LATIN-1 encoding, then add it into appfuse-web-common-2.0-m5.war and override the original one.
After that, I recreate my project and run it, it displays correctly. |
Show » |
|
If I've run "mvn appfuse:full-source", a copy of displaytag_zh_CN.properties is put into src\main\resources folder which is not native2ascii'ed. By the way, I guess this file is extracted from appfuse-web-common-2.0-m5-SNAPSHOT.war.
After I run "mvn jetty:run-war", a another copy of displaytag_zh_CN.properties is put into target\classes folder, but it's strangely encoded. If I use notepad or UltraEdit to open it, the editor displays incorrect characters(as the same as the original display_zh_CN.properties included in appfuse-web-common-2.0-m5.war); if I use Eclipse to open it as an UTF-8 file, Eclipse displays the contents correctly. If I access my application in the browser, it displays incorrect characters as the same as the screen snapshot attached in the previous post.
I've tried modifying project's pom.xml as the following:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>native2ascii-maven-plugin</artifactId>
<version>1.0-alpha-1</version>
<configuration>
<dest>target/classes</dest>
<src>src/main/resources</src>
</configuration>
<executions>
<execution>
<id>native2ascii-utf8</id>
<goals>
<goal>native2ascii</goal>
</goals>
<configuration>
<encoding>UTF8</encoding>
<includes>
ApplicationResources_no.properties,
ApplicationResources_tr.properties,
ApplicationResources_zh*.properties,
displaytag_zh*.properties <!-- Added this line manually -->
</includes>
</configuration>
</execution>
<execution>
<id>native2ascii-8859_1</id>
<goals>
<goal>native2ascii</goal>
</goals>
<configuration>
<encoding>8859_1</encoding>
<includes>
ApplicationResources_de.properties,
ApplicationResources_fr.properties,
ApplicationResources_nl.properties,
ApplicationResources_pt*.properties
</includes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>ApplicationResources_zh*.properties</exclude>
<exclude>ApplicationResources_de.properties</exclude>
<exclude>ApplicationResources_fr.properties</exclude>
<exclude>ApplicationResources_nl.properties</exclude>
<exclude>ApplicationResources_no.properties</exclude>
<exclude>ApplicationResources_pt*.properties</exclude>
<exclude>ApplicationResources_tr.properties</exclude>
<exclude>displaytag_zh*.properties</exclude> <!-- Added this line manually -->
</excludes>
<filtering>true</filtering>
</resource>
</resources>
but it's useless.
Till now, I'm totally puzzled. :(
Regards,
George