What is the default character encoding of the Android system? Which Charset is used?
1 Answer
The default character encoding for Android is UTF-8, as specified by the JavaDoc of the Charset.defaultCharset() method. It can be validated by calling that same method.
6 Comments
Jay Lieske
Fortunately, you don't need to run a program to verify it's UTF-8. The documentation for that method states it outright: developer.android.com/reference/java/nio/charset/…
Maarten Bodewes
@JayLieske If you want UTF-8 you're still better off by indicating the encoding directly. That makes the code more portable, and it would protect you against changes of the Android system.
Virus721
Actually the android developper website says that String objects are using UTF-16, so what do we mean by android default encoding ? the encoding used in strings for applications or something else ?
rpattabi
@pgsandstrom Where do you see default mentioned as UTF-8? The provided link doesn't say that!
xAqweRx
provided link now tells that
defaultCharset > Android note: The Android platform default is always UTF-8. |