-
Notifications
You must be signed in to change notification settings - Fork 114
Description
I noticed that the native writeSerial() on Android
https://github.com/xseignard/cordovarduino/blob/master/src/android/fr/drangies/cordova/serial/Serial.java#L284
uses getBytes(), which "encodes the string using the platform's default charset", which seems to always be UTF-8 on Android
https://developer.android.com/reference/java/nio/charset/Charset.html
while on Ubuntu the string argument is explicitly converted to Latin-1:
https://github.com/xseignard/cordovarduino/blob/master/src/ubuntu/serial.cpp#L94
AFAICS, cordovarduino's documentation does not state anything about character encodings, or how characters with charCode >= 128 will be handled by serial.write(). However, handling this differently depending on the platform may be surprising to users.