Read Japanese Character using Scanner

后端 未结 3 1904
醉梦人生
醉梦人生 2021-01-15 01:41

Possible duplicate: How can I read Chinese characters correctly using Scanner in Java?

My input file name may have japanese characters and I am trying to read the fi

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-15 02:29

    This Answer for Chinese

    Every String is already (conceptually) a sequence of characters, including Chinese characters.. Encoding only comes into it when you need to convert it into a bytes, which you don't need to for your assignment. Just use the String's hashcode. In fact, when you create a HashMap, that's exactly what will happen behind the scene

提交回复
热议问题