aspose file tools*
The moose likes JSF and the fly likes Unable to insert accented letters in JSF application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Unable to insert accented letters in JSF application" Watch "Unable to insert accented letters in JSF application" New topic
Author

Unable to insert accented letters in JSF application

D. Formenton
Ranch Hand

Joined: Mar 20, 2008
Posts: 47
Hi,

I have trouble to insert accented letters in a postgres database from a web application developed with netbeans.

The accented letters become sequeces of 2 or more characters.

Details:

Netabeans ver. 7.1
in faces-config.xml
...
<locale-config>
<default-locale>it_IT</default-locale>
</locale-config>
...

Postgres ver. 9.1
Database Properties:
Encoding WIN1252
Collation Italian_Italy.1252
Character Type Italian_Italy.1252

JSF Library Primefaces v. 3.0.RC2

How I have to configure Netbeans ond/or Postgres to work correctly with Italian alphabet?

Thank you very much.

Domenico


Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16305
    
  21

Your brand of IDE should never have any influence on the webapp. For one thing, production webapps are far removed from the IDEs (if any) that produced them.

Locale actually doesn't control the character set encoding, though. Just the choice of resources. For example, messages in Italian would be the preferred return for resource lookups.

What you really need to look at is the Code Page in effect for the web pages themselves. UTF-8 is the most common, and it does have support for European accented Latin characters. However, for an exact match with your PostgreSQL settings, Code Page Windows-1252 would be the preferred setting, since that way the database and view would be using the exact same encoding.

Code Page Windows-1252 is very similar to the ISO-8859-1 Latin Unicode glyphset, with the most notable exception being things like the open and close-quote characters. ISO-8859-1 is actually preferable (even Microsoft recommends it these days). Non-Windows webclients such as Macintosh, Linux, and Android devices will be the most offended, otherwise.

It's unlikely that you can do anything about it at this stage, but it's worth noting that PostgreSQL's default codepage for database creation on Windows-based servers is CP-1252, but on the Unix systems, it's UTF-8.


Customer surveys are for companies who didn't pay proper attention to begin with.
Brendan Healey
Ranch Hand

Joined: May 12, 2009
Posts: 218
In NetBeans, when editing a .xhtml file, you should just be able to type the '&' character, and get a (very long) list of all the
available characters. Can you give this a try?

Regards,
Brendan.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to insert accented letters in JSF application