some character in html report is break when encode of os is win-1252

Description

issue
when make a report with html format, some character is break.
other format as pdf, xls is not effect.

reason
In line 520 class org.compiere.print.ReportEngine
Writer fw = new OutputStreamWriter(new FileOutputStream(file, false), Ini.getCharset());

with above code. charset use to write file is charset of os. with my case it is "win-1252"
some character cann't convert from "utf-8" to "win-1252".

with pdf and xls report potential error as report ad ticket bellow
https://idempiere.atlassian.net/browse/IDEMPIERE-1213?filter=-2

for fix all error completely error, i think add encode utf-8 to outstream when write file.

Environment

database postgres with encode utf-8
win2008 location has charset is win-1252

Attachments

2

Activity

Show:

Heng Sin LowApril 16, 2014 at 8:26 AM

Sorry, missed that. IMHO, the getCharset changes is not necessary. I would imagine if someone intentionally remove the CharSet property from idempiere.properties, the person probably wants to use the jvm's default charset.

Hiep LqApril 16, 2014 at 8:23 AM

I see. change logic of getCharset make effect to many where. break other implement with default implement. I will remove change of getCharset

Hiep LqApril 16, 2014 at 8:17 AM

in my pack i change Ini.DEFAULT_CHARSET to UTF-8
before Ini.DEFAULT_CHARSET = vm default encode
my pack Ini.DEFAULT_CHARSET to UTF-8

in same logic, i change getCharset
before priority: properties file > vm default encode
my pack priority: properties file > UTF-8 > vm default encode

Heng Sin LowApril 16, 2014 at 8:09 AM

hieplq, what I suggest is we should change Ini.DEFAULT_CHARSET instead.

Heng Sin LowApril 16, 2014 at 6:49 AM

Reopen this. I think out of the box, we should default the encoding to utf-8 in idempiere.properties

Fixed

Details

Assignee

Reporter

Components

Affects versions

Priority

Created August 5, 2013 at 6:55 PM
Updated July 5, 2014 at 2:50 PM
Resolved April 16, 2014 at 3:29 PM