I have string in file, that contains BOM (from UTF-8). I want to convert this string to win-1251 and put it in file.
I trying to remove BOM from string in this way:
out.write(l.replace('uFEFF','') + "
");
But it don't work. Why?
Output of this string in win-1251 file:
?1,...SOME_TEXT_HERE
First "?" sign is illegal.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…