• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Problem I18N with JSF

 
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have problem in I18N with JSF on my application.

My application MUST support multiple language such as English, Thai , Chinese .. etc.

Now i have problem with Thai language.

My solution to do that ::
- use properties file. ( Use UTF-8 Encoding )
- load properties file in jsp page

when i change language that i change Local of context in ManageBean code BUT in jsp page display ???.

I don't khnow how to fix this problem ???

Do you have some solution to solve my problem ?

thank you.
 
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This problem ocurrs in any browser?
Whats you output if you get the Accept-Charset header of your HTTP Connection?
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Isaias C. Barroso:
This problem ocurrs in any browser?



ํำYes, i tested in ie and firefox browser.

Originally posted by Isaias C. Barroso:

Whats you output if you get the Accept-Charset header of your HTTP Connection?



UTF-8
 
Isaias C. Barroso
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Firefox, whats the Character Encoding that is selected when ??? characters are being showed?
 
Isaias C. Barroso
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Menu View -> Character Encoding
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Isaias C. Barroso:
In Firefox, whats the Character Encoding that is selected when ??? characters are being showed?



Default is UNICODE ( UTF-8 ).
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A couple of quick comments.

First, I'm not quite sure how you're doing your i18n - your description doesn't have enough detail. I suspect you may have some problems there, in part because I don't see a discussion of ViewHandlers in your posts. See the postings here -

i18n posting

- for a basic discussion of how to do i18n in JSF apps.

Second, this may very well be a character encoding issue. There's a lack of control by the developer over the response character encoding in JSF 1.1. This has been improved in JSF 1.2 with the addition of the calculateCharacterEncoding(FacesContext) method to ViewHandler, but the problem remains in JSF 1.1 apps or JSF 1.2 apps that don't use this new functionality. A discussion of the default response character encoding algorithm in JSF 1.2 apps can be found here -

View Handler javadoc

In MyFaces/JSP based apps I believe the response encoding is basically just copied from the request encoding. That appears to be the default behavior in Facelets based apps (see FaceletViewHandler).

If everything here is ok - you're localizing correctly and the character encodings of the request and response are both UTF-8 - it's time to check your JVM's character encoding and make sure that it's set to UTF-8 so it can properly read your bundles. You can configure the JVM's character encoding - Google for details.

As part of your debugging process you can use a backing bean to print out Strings from the bundle to your log, to confirm that everything is kosher before the String is written out to the response.

Anyway, those are the places I'd start looking for problems. This post should give you a few things to investigate. Hope that helps.

Regards,

Peter
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic