Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert csv files encoding to utf-8

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?

like image 484
Andrius Avatar asked Sep 09 '13 07:09

Andrius


People also ask

How do I change the encoding to UTF-8?

Click Tools, then select Web options. Go to the Encoding tab. In the dropdown for Save this document as: choose Unicode (UTF-8). Click Ok.

How do I find out if a CSV file is UTF-8 encoded?

The evaluated encoding of the open file will display on the bottom bar, far right side. The encodings supported can be seen by going to Settings -> Preferences -> New Document/Default Directory and looking in the drop down.

How do I convert a CSV file to UTF-8 in Excel 2016?

Go to File and then Save as. At the bottom of the window you will find a dropdown list called Encoding, there select UTF-8 and press Save.


3 Answers

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.)

like image 143
SharkAlley Avatar answered Oct 13 '22 11:10

SharkAlley


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.

like image 45
Andrius Avatar answered Oct 13 '22 10:10

Andrius


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

like image 5
KLeonine Avatar answered Oct 13 '22 11:10

KLeonine