0

UTF-8 not working properly in ZK

asked 2014-05-06 12:16:36 +0800

gsanmartin gravatar image gsanmartin
25 5

updated 2014-05-06 12:46:59 +0800

chillworld gravatar image chillworld flag of Belgium
5337 4 9
https://github.com/chillw...

I am developing a webapp using ZK and I have stumbled upon my first problem, regarding UTF-8 encoding. I set my files to this encoding and when rendering my pages I get the unicode codes (for example, when it should read Contraseña, it says Contrase\u00F1a)

What am I doing wrong? I am using ZK 7.0.1

<groupbox>
    <caption>Login</caption>
    <h:form id="f" name="f" action="j_spring_security_check" method="POST">
        <grid>
            <columns sizable="false">
                <column width="50%" />
                <column width="50%" />
            </columns>
            <rows>
                <row>
                    <label value="${labels.aplicacion.usuario}" />
                    <textbox id="u" name="j_username" />
                </row>
                <row>
                    <label value="${labels.aplicacion.password}" />
                    <textbox id="p" type="password" name="j_password" />
                </row>
                <row spans="2">
                    <div align="center">
                        <h:input type="submit" value="login" />
                        <h:input type="reset" value="Reset" />
                    </div>
                </row>
            </rows>
        </grid>
    </h:form>
</groupbox>

And this is the lines in my zk.xml that declare the resource bundle file:

<library-property>
    <name>org.zkoss.web.preferred.locale</name>
    <value>es_ES</value>
</library-property>

<system-config>
    <label-location>/WEB-INF/i18n/i18n.properties</label-location>
</system-config>
delete flag offensive retag edit

Comments

show your zul please

chillworld ( 2014-05-06 12:36:55 +0800 )edit

I just did. I am using resource bundle properties files.

gsanmartin ( 2014-05-06 12:42:57 +0800 )edit

I can only post here, but your answer did not work for me :(

gsanmartin ( 2014-05-06 14:40:04 +0800 )edit

I don't use the label-location and it works fine for me. Do you have something like this at the beginning of your zul? <?xml version="1.0" encoding="UTF-8"?>

cocoes ( 2014-05-08 10:25:50 +0800 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2014-05-22 00:39:20 +0800

mhj gravatar image mhj flag of Brazil
806 1 7

Hello gsanmartin, in my job I work with eclipse and it sets the system default settings. Mac is utf-8 and windows is win-1252. maybe your project is in a different pattern from the zk zul and this may be conflicting. I hope this could help. Greetings ...

link publish delete flag offensive edit

Comments

i did a fast test on netbeans and put the word "mañana, canção" and it works.

mhj ( 2014-05-22 00:46:55 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
3 followers

RSS

Stats

Asked: 2014-05-06 12:16:36 +0800

Seen: 25 times

Last updated: May 22 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More