0

I have some French codepoints that i would like to decode to utf-8 on a Linux System. The content of my file is (little example):

Lemari%C3%A9%20

Which decoded should be: Lemarié

I read that iconv is a great tool for achieving this but i dont know what i should use as -f argument, because the file content is encoded, so am only trying with the -t option without success: iconv -t UTF8 test.csv

Any advice?

Santosh A
  • 5,173
  • 27
  • 37
JBoy
  • 5,398
  • 13
  • 61
  • 101
  • What are the percent signs for? That makes it look like URL encoded text or something. If you have URL encoded text in your file then I would expect each percent sign to be treated as an individual character by UTF-8. [Your text above, URL decoded](http://urldecode.org/?decode=Lemari%25C3%25A9%2520) and [The correct UTF-8 byte sequence should be this](http://hexutf8.com/?q=#Lemarié) – jar Nov 25 '14 at 15:21

1 Answers1

1

From the man page, following is the command to convert input from ISO88592 encoding format to UTF8 encoding format. output would be the output.txt file.

iconv -f ISO88592 -t UTF8 < input.txt > output.txt

So in your case, -f should be used with the encoding format of the input file. Like

iconv -f <input file encoding format> -t UTF8 < test.csv > output.txt
Santosh A
  • 5,173
  • 27
  • 37
  • thx this was already clear to me, the question is what char encoding to use as `-f` when dealng with encoded strings – JBoy Nov 25 '14 at 10:25