1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-24 17:45:50 +01:00

HPlus: convert text to either GB2312 or UTF-8

This commit is contained in:
João Paulo Barraca 2017-04-12 14:29:24 +01:00
parent c93e97f10f
commit 6ed40a21c6

View File

@ -800,7 +800,10 @@ public class HPlusSupport extends AbstractBTLEDeviceSupport {
cs = new byte[]{HPlusConstants.transliterateMap.get(c)};
} else {
try {
cs = c.toString().getBytes("GB2312");
if (HPlusCoordinator.getLanguage(this.gbDevice.getAddress()) == HPlusConstants.ARG_LANGUAGE_CN)
cs = c.toString().getBytes("GB2312");
else
cs = c.toString().getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
//Fallback. Result string may be strange, but better than nothing
cs = c.toString().getBytes();