41

What is the default character encoding of the Android system? Which Charset is used?

1 Answer 1

58

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.

Sign up to request clarification or add additional context in comments.

6 Comments

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/…
@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.
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 ?
@pgsandstrom Where do you see default mentioned as UTF-8? The provided link doesn't say that!
provided link now tells that defaultCharset > Android note: The Android platform default is always UTF-8.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.