简体   繁体   English

手机之间的Android编码支持不同

[英]Android encoding support different between phones

I have a problem when encoding in Android 在Android中编码时出现问题

new ByteArrayOutputStream().write("ĐŠŽĆČđšžćč".getBytes("CP852"));

Samsung Galaxy S6 Edge+ has no problem when this encoding CP852(or any other for that matter) while for example Samsung Galaxy S4 throws Unsupported Encoding Exception for CP852, CP858, CP857 and similar, but CP1250, CP1251 and so on work correctly. 当此编码CP852(或与此有关的任何其他编码)时,Samsung Galaxy S6 Edge +没问题,例如,Samsung Galaxy S4抛出CP852,CP858,CP857等类似的不支持的编码异常,但是CP1250,CP1251等可以正常工作。

Is there any way to go around this issue, a library? 有没有办法解决这个问题,图书馆? CP852 is required supported encoding. 需要CP852支持的编码。

Thank you in advance! 先感谢您!

Yes, you should use extra code to transcode unicode data to cp852. 是的,您应该使用额外的代码将unicode数据转码为cp852。 You may use some library or even do it by yourself. 您可以使用某些库,甚至可以自己使用。 It shouldn't be very hard. 应该不难。 Here you can find cp852 to unicode mapping. 在这里,您可以找到cp852到unicode的映射。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM