View Full Version : [kubuntu] kate turns accents into '?' or chinese ideograms

May 30th, 2010, 06:41 PM
Hello all,
I have a problem with opening files with accents with the kate editor.
They are html files written on Windows, and contain the line

<META HTTP-EQUIV="Content-type" CONTENT="text/html; CHARSET=Windows-1252">

Opening in kate, no matter the encoding, messes up the characters. They turn to � (a '?' in a hexagone) or chinese characters!

What's the proper procedure to open and save those files properly in kate ?

May 30th, 2010, 09:08 PM
Well, I found a solution, kinda. If I've never opened and resaved them before with kate, I run
perl -pi -e 's/Windows-1252/ISO-8859-1/' *.html on them. If I have changed them, then I need to re-edit them, or possibly play with the iconv command if I can figure out an encoding first. Say, if I open them as UTF-8 in kate and see the proper accents, then I can run
iconv -f UTF-8 -t ISO-8859-1 MyFile.html > MyFile.html
Is that correct ?