mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-06-05 21:49:48 +02:00
HPlus: convert text to either GB2312 or UTF-8
This commit is contained in:
@@ -800,7 +800,10 @@ public class HPlusSupport extends AbstractBTLEDeviceSupport {
|
|||||||
cs = new byte[]{HPlusConstants.transliterateMap.get(c)};
|
cs = new byte[]{HPlusConstants.transliterateMap.get(c)};
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
|
if (HPlusCoordinator.getLanguage(this.gbDevice.getAddress()) == HPlusConstants.ARG_LANGUAGE_CN)
|
||||||
cs = c.toString().getBytes("GB2312");
|
cs = c.toString().getBytes("GB2312");
|
||||||
|
else
|
||||||
|
cs = c.toString().getBytes("UTF-8");
|
||||||
} catch (UnsupportedEncodingException e) {
|
} catch (UnsupportedEncodingException e) {
|
||||||
//Fallback. Result string may be strange, but better than nothing
|
//Fallback. Result string may be strange, but better than nothing
|
||||||
cs = c.toString().getBytes();
|
cs = c.toString().getBytes();
|
||||||
|
Reference in New Issue
Block a user