Created
February 15, 2011 03:42
-
-
Save osima/827059 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 数値参照を普通の文字に変換する | |
| def convert = { | |
| def r = it | |
| if (it.indexOf("&#x") != -1){ | |
| def m2 = (it =~ /&#x(.+?);/) | |
| if( m2.find() ){ r = (char) Integer.parseInt(m2.group(1), 16) } | |
| } | |
| else{ | |
| def m2 = (it =~ /&#(.+)?;/) | |
| if( m2.find() ){ r = (char) Integer.parseInt(m2.group(1)) } | |
| } | |
| r | |
| } | |
| println convert('⇓') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment