Java Utililty Methods String to Unicode

List of utility methods to do String to Unicode

  1. HOME
  2. Java
  3. S
  4. String to Unicode

Description

The list of methods to do String to Unicode are organized into topic(s).

Method

String convertStringToUnicodeString(String s)
Converts a regular java string to its unicode string representation

StringBuffer convert = new StringBuffer();
for (int i = 0; i < s.length(); i++) {
 char ch = s.charAt(i);
 if ((byte) ch >= 0 && (int) ch <= 255)
 convert.append(ch);
 else {
 if ((int) ch > 255 || (int) ch < 0)
 throw new Exception("Invalid Character: " + ch);
...

AltStyle によって変換されたページ (->オリジナル) /