Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • char in Java is a 16 bit value and char arrays are also assumed to be UTF-16 encoded. docs.oracle.com/javase/7/docs/api/java/lang/… If you mean to store strings in different encodings, I think you must use byte arrays instead. To get differently encoded strings, there is String.getBytes. Commented Mar 12, 2022 at 12:39
  • String objects are storing their data in an underlaying char[]. There can be no difference in encoding capabilities. Commented Aug 26, 2024 at 22:19