4

I get error when converting a large file:

$ iconv -f GB2312 -t UTF-8 2001.txt -o 2001_u.txt
iconv: illegal input sequence at position 245256667

What does the position mean in this error? I tried it is not line number. How to get to the position in other tools or editors like emacs?

4

It's the 245256667 byte of the file. If you do a:

dd if=2001.txt of=error.txt bs=1 count=10 skip=245256667

You should be able to see the non valid utf8 sequence by doing a hexdump -C error.txt

0

With vim you can just

:go POSITION+1

e.g.

:go 245256668

or alternatively, in command mode :

POSITION+1go

that is

245256668go

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.