aegleston Posted December 10, 2009 Share Posted December 10, 2009 Hi,We use JasperServer 3.0 (will be upgrading soon to 3.5). We are trying to export a csv type report with UTF-8 encoding. The file appears to be ANSI encoded every time. So far we have:1) Set the URIEncoding = "UTF-8" in the server.xml file in $TOMCAT_BASE/conf.2) Added the following line in $TOMCAT_BASE/webapps/jasperserver/WEB-INF/classes/jasperreports.properties:net.sf.jasperreports.export.character.encoding=UTF-8I have searched the forums for JasperServer, iReport and JasperReports.Is there a way to make the csv file use UTF-8 encoding?Thanks.Andy Link to comment Share on other sites More sharing options...
lucianc Posted December 14, 2009 Share Posted December 14, 2009 JS should output UTF-8 CSV files in the default configuration. Are you sure that the CSV files that you get are not UTF-8?Regards,Lucian Link to comment Share on other sites More sharing options...
aegleston Posted December 16, 2009 Author Share Posted December 16, 2009 I am not sure. Here is what I did. I downloaded the .csv report from our JasperServer website onto my Windows machine. I then viewed the character encoding in Firefox by changing. csv to .html and navigating to View and Character Encoding. This showed ISO-8859-1. I then viewed the file in TextPad. Textpad seemed to think the file was ANSI encoded.So it seems not to be a UTF-8 encoded file but I don't know for sure.AndyPost Edited by aegleston at 12/16/2009 15:48 Link to comment Share on other sites More sharing options...
swood Posted December 20, 2009 Share Posted December 20, 2009 You have to set the locale when the user logs in. Then the CSV export will be UTF-8. I don't know whether this is right. It think the CSV should always be UTF-8 when the server and JasperReport properties are set to UTF-8. ShermanJaspersoft Link to comment Share on other sites More sharing options...
lucianc Posted December 21, 2009 Share Posted December 21, 2009 Can you upload the (unmodified) CSV here?Regards,Lucian Link to comment Share on other sites More sharing options...
aegleston Posted December 30, 2009 Author Share Posted December 30, 2009 Attached is a sample report. Thanks.Andy Link to comment Share on other sites More sharing options...
lucianc Posted December 30, 2009 Share Posted December 30, 2009 And how exactly is this not UTF-8? I feel like I'm missing the point here..Regards,Lucian Link to comment Share on other sites More sharing options...
aegleston Posted December 30, 2009 Author Share Posted December 30, 2009 According to Textpad the file is still ANSI encoded. I'm probably the one missing the point here. How do you know the file is UTF-8 encoded? Please note I had to remove any columns (in the report definition) with text because they contained customer data. When this report goes into production it will contain text columns with names and email addresses.Thanks.Andy Link to comment Share on other sites More sharing options...
lucianc Posted December 31, 2009 Share Posted December 31, 2009 UTF-8 is compatible with ASCII, i.e. characters in the ASCII set have the same encoding in ASCII and UTF-8. So if you have a file that contains only characters from the ASCII set, there won't be any difference between its ASCII and UTF-8 representations.If you want to check that the file is UTF-8 encoded, include a non-ASCII character in it.Regards,LucianPS: UTF-8 files can have a BOM character at the beginning as a hint on the encoding, but that can cause problems in certain situations so JS does not use it. 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