0

input file with 50k plus unix file command shows it as ISO-8859 text, with very long lines

input record causing issue MONTRéAL

when i use iconv command like below nothing changes, record is as-is


**iconv -f ISO-8859-1 -t UTF-8 input.txt -o output.txt**

when i copy the specific record in question using sed command, file is created as utf-8 and the record looks good

**MONTRéAL**
**sed -n '41696p' input.txt > output.txt**

when i copy from 1 through 41696 with the same sed command, record didn't change

**sed -n '1,41696p' input.txt > output.txt**

how do I copy the file from iso-8859 to utf-8 with proper characterset??

Talha
  • 524
  • 1
  • 6
  • 22
  • 1
    What are you using to view the record to see whether it's "good" or not? One theory is that the file is already using the utf-8 encoding, but whatever you're using to view it thinks it's ISO-8859 because it's not looking deep enough into the file to know that it's not. That would explain why it looks okay when you just have the one line. What happens if you do, say, `sed -n '41600,41696p' input.txt > output.txt` ? – jas Nov 25 '20 at 20:03
  • i just use vi editor to view the file – Krrp78 Nov 25 '20 at 20:08

0 Answers0