使用与此处相同的项目和文本文件:Java.NullPointerException null (again)该程序正在输出数据,但带有 
。把你放在照片中:
This program is a telephone directory, ignoring the first "code" block, look at the second "code" block on that link, that is the text file with the entries. The program outputs them as it should but it is giving

at the beginning of the entries read from the text file ONLY.
关于如何删除它的任何帮助?我正在使用带有文件阅读器的缓冲阅读器。
- 文本文件编码:UTF-8
- 使用 Java 7
- Windows 7
最佳答案
读入的文本文件是否使用带 BOM 的 UTF-8?它看起来像 BOM 标志:“” http://en.wikipedia.org/wiki/Byte_order_mark
你在运行 Windows 吗? Notepad++ 应该可以转换。如果使用 linux 或 VI(M) 你可以使用 ":set nobomb"
关于java - 从文本文件读取时显示符号 '  ',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14710366/