Created
August 22, 2011 03:27
-
-
Save osima/1161594 to your computer and use it in GitHub Desktop.
Try to find char u3000.
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
| import java.io.*; | |
| public class Test{ | |
| private static char SPACE='\u3000'; | |
| public static void main(String[] args){ | |
| if(args.length<1){ | |
| System.exit(0); | |
| } | |
| File f=null; | |
| String ENC="SJIS"; | |
| if(args.length>=1) | |
| f=new File(args[0]); | |
| if(args.length>=2) | |
| ENC=args[1]; | |
| try{ | |
| BufferedReader br= new BufferedReader(new InputStreamReader( new FileInputStream(f),ENC)); | |
| String line=null; | |
| while( (line=br.readLine())!=null ){ | |
| for(int i=0; i<line.length(); i++){ | |
| if(SPACE==line.charAt(i)){ | |
| int code=(int)(line.charAt(i)); | |
| System.out.println("Found ideographics space: "+Integer.toHexString(code) ); | |
| } | |
| else{ | |
| System.out.println(line.charAt(i)); | |
| } | |
| } | |
| } | |
| br.close(); | |
| } | |
| catch(Exception ex){ | |
| ex.printStackTrace(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment