9

I have a csv file which contains special characters. However, when I import them into my table they do not import. I have the row that needs to contain special characters setup as utf8_general_ci

However, I am losing the special characters upon phpmyadmin import. For example, the degree symbol is not importing. I viewed my csv file in a text editor and it does contain the special characters.

Please help.

Ok, I figured how to do this. See my answer below.

MagentoMan
  • 553
  • 4
  • 8
  • 19

5 Answers5

15

Only needs change the charset in mysql when try to upload the file. In my case works the charset windows-1252

Charset on mysql

Raugaral
  • 1,303
  • 13
  • 25
9

Ok,

for anyone who has this same issue trying to keep the exported csv file in utf8 while keeping the special characters do the following.

Open up your file in OpenOffice Calc. When you get ready to save it save it as text csv file. While exporting it will ask you what format to save it as. Save it as UTF8 and presto. It does not convert your special characters like excel does.

Hope that helps someone else.

MagentoMan
  • 553
  • 4
  • 8
  • 19
  • Thank you - that worked! Actually did this with EmEditor. Opened a file, and then saved it as "UTF-8 Without Signature". – itoctopus Apr 23 '18 at 17:42
4

Excel usually outputs CSV as UTF-16, but there are ways to get it to output in UTF-8 as explained here

If you are on Windows you can also use the standard Notepad text editor to convert the file by selecting UTF-8 encoding in the Save As dialog as shown below: enter image description here

Community
  • 1
  • 1
Glenn Lawrence
  • 2,844
  • 1
  • 32
  • 38
1

Try to convert the charset of your csv file to utf8. For exemple with Notepad++

Encoding -> Convert to UTF-8 without BOM
Georgio
  • 149
  • 3
  • Thanks I downloaded Notepadd++ When viewing the file in that I see odd character replacements. I then convert it and I still see the odd characters. However, when viewing in another text editor I see the correct symbols. Any idea? – MagentoMan Jan 20 '14 at 19:45
  • You know the charset of your file ? By default, Notepad++ open the files with ANSI charset, maybe that your file is encoded in another charset... – Georgio Jan 20 '14 at 20:00
  • It should be utf8 but I converted it to that and still see the issue – MagentoMan Jan 20 '14 at 20:24
0

Maybe you must check setup as csv file. I think you problem begin in this file. Check this and make sure that both coding were the same(csv and sql table)

starko
  • 1,150
  • 11
  • 26