๐ I got sql file from friend who uses Windows
But I could not execute it on my Mac because of character error
Windows | Mac |
---|---|
Shift JIS | UTF-8 |
โผ Japanese characters are corrupted
INSERT INTO Shain(Id,CreateDate,Sei,Mei,Tel,Bikou) VALUES(1,'2010/07/23 12:19:45','ono1','shinichi1','1-a-1','โโขยฌรยฌรดโยฎยฌรยฌรAAAAAA1')
INSERT INTO Shain(Id,CreateDate,Sei,Mei,Tel,Bikou) VALUES(2,'2010/07/23 12:20:45','ono2','shinichi2','1-a-2','โโขยฌรยฌรดโยฎยฌรยฌรAAAAAA2')
INSERT INTO Shain(Id,CreateDate,Sei,Mei,Tel,Bikou) VALUES(3,'2010/07/23 12:21:45','ono3','shinichi3','1-a-3','โโขยฌรยฌรดโยฎยฌรยฌรAAAAAA3')
INSERT INTO Shain(Id,CreateDate,Sei,Mei,Tel,Bikou) VALUES(4,'2010/07/23 12:22:45','ono4','shinichi4','1-a-4','โโขยฌรยฌรดโยฎยฌรยฌรAAAAAA4')
...
๐ How to resolve it?
install nkf
$ brew install nkf
// check file character code
$ nkf -g file.sql
Shift_JIS
// I wanna change to UTF-8
$ nkf -w --overwrite file.sql
then resolved !
INSERT INTO Shain(Id,CreateDate,Sei,Mei,Tel,Bikou) VALUES(1,'2010/07/23 12:19:45','ono1','shinichi1','1-a-1','ๅ่AAAAAA1')
INSERT INTO Shain(Id,CreateDate,Sei,Mei,Tel,Bikou) VALUES(2,'2010/07/23 12:20:45','ono2','shinichi2','1-a-2','ๅ่AAAAAA2')
INSERT INTO Shain(Id,CreateDate,Sei,Mei,Tel,Bikou) VALUES(3,'2010/07/23 12:21:45','ono3','shinichi3','1-a-3','ๅ่AAAAAA3')
INSERT INTO Shain(Id,CreateDate,Sei,Mei,Tel,Bikou) VALUES(4,'2010/07/23 12:22:45','ono4','shinichi4','1-a-4','ๅ่AAAAAA4')
Top comments (2)
Thanks for sharing I did not know this kanji code converter.
You're welcome !