matienzar Posted June 23, 2009 Share Posted June 23, 2009 Hello, From java applications, we have properties files with UTF-8 charset. When we want to use these properties files with ireport, we have problem with characters like "áéíóú", because ireport reads it in ISO-8851. what can we do? Lot of thanks Link to comment Share on other sites More sharing options...
lucianc Posted June 29, 2009 Share Posted June 29, 2009 Property files are read as Latin-1, see java.util.Properties.Regards,Lucian Link to comment Share on other sites More sharing options...
matienzar Posted June 29, 2009 Author Share Posted June 29, 2009 GWT use UTF-8 to .properties, and we would like to use the same file properties. With this, we need to file properties, it's ok? Link to comment Share on other sites More sharing options...
lucianc Posted June 29, 2009 Share Posted June 29, 2009 I don't understand your question. Link to comment Share on other sites More sharing options...
matienzar Posted June 29, 2009 Author Share Posted June 29, 2009 It's to say. We have a J2EE application with UTF-8 charset, with .properties with utf8 format, and we would like to use these properties files with jasper too, but jasperreports works with latin1 how java properties api say. We have 2 solutions: - Change charset of the application to UTF-8 - Working with to properties files, one in latin1 and another in utf-8 My question, is it the right way? Lot of thanks Link to comment Share on other sites More sharing options...
lucianc Posted July 1, 2009 Share Posted July 1, 2009 Well, the solution you choose depends on the architecture of your application.If you want to use the default JasperReports resource bundle support (which relies on java.util.ResourceBundle and property files), you'll need to have Latin-1 properties file with Unicode escapes. This can be achieved in several ways, for instance by using native2ascii at build time to transform the property files.Another option is to take the resource bundle loading into your own hands, load the UTF-8 property files as java.util.ResourceBundle instances and pass such instances to the reports via the REPORT_RESOURCE_BUNDLE parameter. You can find some ideas on how to load UTF-8 property files as resource bundles on the Java forums, see for example http://www.thoughtsabout.net/blog/archives/000044.html or the java.util.ResourceBundle.Control class introduced in Java 1.6.Regards,Lucian Link to comment Share on other sites More sharing options...
artiomcom Posted August 21, 2019 Share Posted August 21, 2019 Convert your property file to UTF-8 without BOM. That is. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now