Results 1 to 10 of 16

Thread: Roo Encoding issue

Hybrid View

  1. #1
    Join Date
    Sep 2009
    Posts
    14

    Question Roo Encoding issue

    Hello,

    When generating a simple web project it seems that the encoding is somehow broken, at least on my computer.

    It seems that it doesn't sent data in UTF-8 format, so the special characters (such as éàô etc.) cannot be interpreted correctly.

    I tried a simple web project and tested with System.out.println("éééé"); without luck, and also a Spring-Flex project:
    When accessing the exposed AMF service from Flex, the character encoding is also broken.

    Needless to say that everything is set to use UTF-8 (Maven,Tomcat, Hibernate, Eclipse workspace), and that everything works as expected if NOT using Roo.

    Windows 7 x64
    STS 2.5.2 32bit
    Roo 1.1.1.RELEASE
    Maven 3.0.2

    Anyone else having similar issues ?

  2. #2
    Join Date
    Nov 2010
    Posts
    4

    Default Re: Roo Encoding issue

    Hello Astronaute,

    I'm working with a simple jspx, spring, hibernate project and have the same issue. I use characters like á, é, í, ó, ú, ñ.

    My issues are in:
    * Inputs fields in post actions
    * Labels code in message.properties and applications.properties files.

    I try solve this with replace all "ISO-8859-1" to "UTF-8" in all .jspx and .xml files in the project, and a lot of tomcat files with same string.

    My development environment is:
    Linux Mint 9 x64
    STS 2.5.0 32bit
    Roo 1.1.0.RELEASE
    Maven 3.0-SNAPSHOT

    Please help us!!

  3. #3

    Default

    Hello,
    is there any update on this?
    We are having the same problem.

    thanks & best,
    Milan

  4. #4
    Join Date
    Jan 2011
    Posts
    7

    Default

    Hi folks,
    I've experienced such problem using MySQL... In default generated project all special characters wrote to DB as "???"

    Update database.properties with
    database.url=jdbc\:mysql\://localhost\:3306/[YOUR_DB_NAME]?autoReconnect\=true&useUnicode\=true&characterEnc oding\=UTF-8

  5. #5
    Join Date
    Sep 2009
    Posts
    14

    Default

    Quote Originally Posted by Tigra View Post
    Hi folks,
    I've experienced such problem using MySQL... In default generated project all special characters wrote to DB as "???"

    Update database.properties with
    As I already stated, even the simple...
    Code:
    System.out.println("éééé");
    ... is broken, it has nothing to do with the database, which btw is set to UTF-8 as is everything else on my computer, so it is definitely a Roo issue*

  6. #6

    Default

    just to confirm that

    database.url=jdbc\:mysql\://localhost\:3306/[YOUR_DB_NAME]?autoReconnect\=true&useUnicode\=true&characterEnc oding\=UTF-8

    fixed our issue with encoding.

    thanks Tigra,
    best,
    Milan

  7. #7
    Join Date
    Nov 2010
    Posts
    4

    Default

    Quote Originally Posted by clandestino_bgd View Post
    just to confirm that



    fixed our issue with encoding.

    thanks Tigra,
    best,
    Milan
    Clandestino: in my mysql the encoding is working perfect. My problem is from the POST to the method in the controller class for example:

    In the page I write "ééé" in a input box, and do a post
    In the controller, the input box content is "ééé" the problem persist with bind with a bean as controller method parameter.

    I patched this with a corrector method, but it's only working in the post to server and if the string content is in lowercase()

    st = st.replaceAll("á", "á");
    st = st.replaceAll("é", "é");
    st = st.replaceAll("Ã*", "í");
    st = st.replaceAll("ó", "ó");
    st = st.replaceAll("ú", "ú");
    st = st.replaceAll("ñ", "ñ");

  8. #8

    Default

    Djorco,
    I don't know what to suggest apart from already reported on forum and jira.
    Basically 3 things need to be done:
    1. database url in database properties
    2. character encoding filter mapping as first in web.xml
    3. your database charset is UTF-8

    With those we don't have any problem submitting german and russian characters in roo generated forms.

    hth,
    Milan

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •