You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Azfar Kazmi <az...@gmail.com> on 2015/11/17 23:04:44 UTC

SpecialPropertySet hard codes ASCII charset

I am using 3.13 and noticed that SpecialPropertySet now uses hard coded
ASCII charset when it creates a new String out of byte[]. This change was
introduced in September by revision 1700677.

It broke some of my test cases (where a POT file has non-ASCII characters
in doc properties - see attached). Aren't we better off without this change
(hence use system's default charset)? Or, better yet, why not allow user to
provide the charset and default to ASCII if not provided?

I can create a bug and patch if there's agreement on either.

Azfar

Re: SpecialPropertySet hard codes ASCII charset

Posted by Nick Burch <ap...@gagravarr.org>.
On Wed, 18 Nov 2015, Azfar Kazmi wrote:
> I have attached a unit test and ppt file that it uses.

Any chance you could open a bug in bugzilla, and attach both their? The 
mailing list tends to eat attachments is one issue, forgetting about 
issues not in bugzilla is another...!

Thanks
Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: SpecialPropertySet hard codes ASCII charset

Posted by Azfar Kazmi <az...@gmail.com>.
Nick,

I have attached a unit test and ppt file that it uses.

Azfar

On Tue, Nov 17, 2015 at 2:37 PM, Nick Burch <ap...@gagravarr.org> wrote:

> On Tue, 17 Nov 2015, Azfar Kazmi wrote:
>
>> I am using 3.13 and noticed that SpecialPropertySet now uses hard coded
>> ASCII charset when it creates a new String out of byte[]. This change was
>> introduced in September by revision 1700677.
>>
>
> That was as part of the "forbidden APIs" cleanup, to get POI consistent
> across all machines/locales
>
> It broke some of my test cases (where a POT file has non-ASCII characters
>> in doc properties - see attached). Aren't we better off without this change
>> (hence use system's default charset)? Or, better yet, why not allow user to
>> provide the charset and default to ASCII if not provided?
>>
>
> If things need turning from bytes back to Strings, would it not be better
> to prompt the user to give us a String in the first place then, rather than
> messing around with bytes?
>
> I can create a bug and patch if there's agreement on either.
>>
>
> If we could have one of your unit tests, that'd be a big help for
> understanding the use-case and current usage
>
> Thanks
> Nick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
>
>

Re: SpecialPropertySet hard codes ASCII charset

Posted by Nick Burch <ap...@gagravarr.org>.
On Tue, 17 Nov 2015, Azfar Kazmi wrote:
> I am using 3.13 and noticed that SpecialPropertySet now uses hard coded 
> ASCII charset when it creates a new String out of byte[]. This change 
> was introduced in September by revision 1700677.

That was as part of the "forbidden APIs" cleanup, to get POI consistent 
across all machines/locales

> It broke some of my test cases (where a POT file has non-ASCII 
> characters in doc properties - see attached). Aren't we better off 
> without this change (hence use system's default charset)? Or, better 
> yet, why not allow user to provide the charset and default to ASCII if 
> not provided?

If things need turning from bytes back to Strings, would it not be better 
to prompt the user to give us a String in the first place then, rather 
than messing around with bytes?

> I can create a bug and patch if there's agreement on either.

If we could have one of your unit tests, that'd be a big help for 
understanding the use-case and current usage

Thanks
Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org