List of usage examples for java.lang Character INITIAL_QUOTE_PUNCTUATION
byte INITIAL_QUOTE_PUNCTUATION
To view the source code for java.lang Character INITIAL_QUOTE_PUNCTUATION.
Click Source Link
From source file:Main.java
public static void main(String[] args) { for (char ch = Character.MIN_VALUE; ch < Character.MAX_VALUE; ch++) { if (Character.INITIAL_QUOTE_PUNCTUATION == Character.getType(ch)) { String s = String.format("\\u%04x", (int) ch); System.out.println(s); }/* w w w.j av a2s . c o m*/ } }
From source file:org.grails.datastore.bson.json.JsonWriter.java
private void writeStringHelper(final String str) throws IOException { writer.write('"'); for (final char c : str.toCharArray()) { switch (c) { case '"': writer.write("\\\""); break; case '\\': writer.write("\\\\"); break; case '\b': writer.write("\\b"); break; case '\f': writer.write("\\f"); break; case '\n': writer.write("\\n"); break; case '\r': writer.write("\\r"); break; case '\t': writer.write("\\t"); break; default:/*from w ww . j a v a 2 s. c o m*/ switch (Character.getType(c)) { case Character.UPPERCASE_LETTER: case Character.LOWERCASE_LETTER: case Character.TITLECASE_LETTER: case Character.OTHER_LETTER: case Character.DECIMAL_DIGIT_NUMBER: case Character.LETTER_NUMBER: case Character.OTHER_NUMBER: case Character.SPACE_SEPARATOR: case Character.CONNECTOR_PUNCTUATION: case Character.DASH_PUNCTUATION: case Character.START_PUNCTUATION: case Character.END_PUNCTUATION: case Character.INITIAL_QUOTE_PUNCTUATION: case Character.FINAL_QUOTE_PUNCTUATION: case Character.OTHER_PUNCTUATION: case Character.MATH_SYMBOL: case Character.CURRENCY_SYMBOL: case Character.MODIFIER_SYMBOL: case Character.OTHER_SYMBOL: writer.write(c); break; default: writer.write("\\u"); writer.write(Integer.toHexString((c & 0xf000) >> 12)); writer.write(Integer.toHexString((c & 0x0f00) >> 8)); writer.write(Integer.toHexString((c & 0x00f0) >> 4)); writer.write(Integer.toHexString(c & 0x000f)); break; } break; } } writer.write('"'); }