How to convert csv files encoding to utf-8
Asked Answered
A

6

33

Is it possible to convert csv data that has iso-8859-13 encoding to UTF-8?

My old system does not have UTF-8 encoding, it uses only iso-8859-13. The system that I need to import to does not have iso-8859-13, but has both UTF-8 and UTF-16. If I try to open the csv file with an encoding other than iso-8859-13, then some symbols are not recognized. If I try to import such file into the new system, it gives an error that I have wrong encoding. I can only import it using windows-1252, but then it will import with unrecognized symbols. What can I do to convert it to normal encoding such as UTF-8?

Antechamber answered 9/9, 2013 at 7:11 Comment(0)
A
19

I was able to convert simply using text editor. I opened csv file with iso-8859-13 encoding. Then created empty csv file with utf-8. Then simply copied everything from one csv to another. Then I could import it into new system.

Previously I tried to do this with libreoffice, but for some reason it would save with iso-8859-13 encoding.

Antechamber answered 9/9, 2013 at 10:48 Comment(2)
One side note: This worked as expected but I made a mistake of saving the file to CSV again. This totally messed up my file :) One should probably save it to some binary format (e.g. xlsx) in order to retain changes ;)Marcel
The same process will work in Linux using Kate and/or Kwrite as the editor rather than Notepad or Notepad++ from Windows.Throat
V
39

Open the file in Notepad++ and click Encoding->Convert to UTF-8.

(Do not click Encode in UTF-8 because it won't actually convert the characters.)

Vday answered 27/2, 2014 at 4:22 Comment(4)
made my half-day. the other half I spent searchingGoebel
I had to do "Convert to UTF-8-BOM"Aldred
I did first "Convert to UTF-8-BOM" and then "Convert to UTF-8". This saved my umlautsShoffner
you saved my life 10 years later in the future bro, thank you a lot for the simple guide, it worked!Fey
A
19

I was able to convert simply using text editor. I opened csv file with iso-8859-13 encoding. Then created empty csv file with utf-8. Then simply copied everything from one csv to another. Then I could import it into new system.

Previously I tried to do this with libreoffice, but for some reason it would save with iso-8859-13 encoding.

Antechamber answered 9/9, 2013 at 10:48 Comment(2)
One side note: This worked as expected but I made a mistake of saving the file to CSV again. This totally messed up my file :) One should probably save it to some binary format (e.g. xlsx) in order to retain changes ;)Marcel
The same process will work in Linux using Kate and/or Kwrite as the editor rather than Notepad or Notepad++ from Windows.Throat
G
5

For those who don't know how to convert the file's encoding using Notepad++ : Create a new file in Notepad++ -> Go to Encoding -> Encode in UTF-8 -> Copy-paste the contents -> save the file as .csv

Goeger answered 31/1, 2014 at 16:15 Comment(0)
D
2

For me worked that way: Open CSV file with regular Notepad. Save as in Notepad and set encoding like in picture.Encoding

Dickdicken answered 20/9, 2018 at 6:57 Comment(0)
A
1

Copying .csv content from Excel to Notepad++ does not preserve format, open original .csv in Notepad++ and copy from there.

  1. Once opened in Notepad++, create new file in Notepad++ using 'Ctrl + n'.
  2. Go to Encoding -> Convert to UTF-8-BOM -> Copy-paste the contents -> save the file as .csv.

(Windows 10)

Adams answered 23/5, 2020 at 18:26 Comment(0)
P
0

I opened my file in MS Notepad, and then the File > Save As menu would let me choose the encoding.

Screenshot

Palette answered 29/1 at 4:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.