azure-sdk-for-java icon indicating copy to clipboard operation
azure-sdk-for-java copied to clipboard

Locale consistency: Some APIs use getBytes() and some use getBytes("UTF-8")

Open jcookems opened this issue 14 years ago • 2 comments

Dev estimate: 0.5 Test estimate: 0.5

In .../services/serviceBus/implementation/BrokerPropertiesMapper.java, we have this code:

return mapper.readValue(value.getBytes(), BrokerProperties.class);

This is inconsistent from the rest of the uses of getBytes in the SDK, which always specify UTF-8 encoding. When no encoding is specified, the "platform's default charset" is used.

This could lead to problems, because this means that the behavior of the BrokerPropertiesMapper is dependent on the platform settings, while the rest of the SDK is invariant.

jcookems avatar Nov 08 '12 21:11 jcookems

https://github.com/gcheng/azure-sdk-for-java/pull/35

gcheng avatar Apr 23 '13 01:04 gcheng

this fix should be good, no test needed

xuezhai avatar Apr 26 '13 00:04 xuezhai