Why am i getting ?? when i try to read ä character from a text file in java?

后端 未结 2 1502
南旧
南旧 2021-01-29 05:51

I am trying to read text from a text file. There are some special characters like å,ä and ö. When i make a string and print out that string then i get ?? from these special char

2条回答
  •  有刺的猬
    2021-01-29 06:17

    Check here for the lists of Java supported encodings

    Most common single-byte encoding that includes non-ascii characters is ISO8859_1; maybe your file is that, and you should specifiy that encoding for your FileInputStream

提交回复
热议问题