java - Latin Character Inbetween String -
i have program read in file contain latin words such "\xed". these latin words can appear anywhere in between line, such have program parsing these character. there library can so?
the simple way inputstreamreader "utf8" format. example:
try { file filedir = new file("c:/temp/sample.txt"); bufferedreader in = new bufferedreader( new inputstreamreader( new fileinputstream(filedir), "utf8")); string str; while ((str = in.readline()) != null) { system.out.println(str); } in.close(); } catch (unsupportedencodingexception e) { system.out.println(e.getmessage()); } catch (ioexception e) { system.out.println(e.getmessage()); } catch (exception e) { system.out.println(e.getmessage()); }
Comments
Post a Comment