简体   繁体   中英

Validation Messages GWT i18n Encoding Issue

I use Java, GWT, Spring, Maven and Tomcat. Field validation messages stored in .properties files each of them saved UTF-8 encoding. One of these files has words written in Russian, so when I change web interface language to Russian I receive validation message in wrong encoding like this:

не должно бÑÑÑ null

(right message from file looks like: не должно быть null)

Localization messages provides by class which extends com.google.gwt.i18n.client.Messages

Any suggestions?

I solved my problem with Native2Ascii Maven plugin. This problem was solved by choosing right working directory ('target' directory not 'source') and right phase of plugin execution. 'test' phase works for me. So files are copying in target directory and then converting in ANSI encoding, but original files remain unchanged.Here my configuration:

<project>
  [...]
  <build>
    [...]
    <plugins>
      [...]
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>native2ascii-maven-plugin</artifactId>
        </executions>
          <execution>
            <execution>
                    <id>native2ascii-utf8-validation</id>
                    <phase>test</phase>
                    <goals>
                        <goal>native2ascii</goal>
                    </goals>
                    <configuration>
                        <encoding>UTF8</encoding>
                        <includes>
                            <include>ValidationMessages*.properties</include>
                        </includes>
                        <workDir>${basedir}/target/classes/app/validation</workDir>
                    </configuration>
                </execution>
          </execution>
          [...]
        </executions>
        [...]
      </plugin>
      [...]
    </plugins>
    [...]
  </build>
  [...]
</project>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM