Skip to content

Instantly share code, notes, and snippets.

@mid0111
Last active August 29, 2015 14:15
Show Gist options
  • Save mid0111/7707cdd5dc7c48a7dd5f to your computer and use it in GitHub Desktop.
Save mid0111/7707cdd5dc7c48a7dd5f to your computer and use it in GitHub Desktop.
Javaの制御コード話
import static org.fest.assertions.Assertions.assertThat;
import org.apache.commons.lang.StringEscapeUtils;
import org.junit.Test;
public class Unescape {
@Test
public void convertUnescapedUnicodeString() {
String before = "abcd\\u0001efgh\\u0001";
String after = StringEscapeUtils.unescapeJava(before);
System.out.println(after);
assertThat(after).isEqualTo("abcd\u0001");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment