开发者

How can I preserve punctuation characters when using iconv?

开发者 https://www.devze.com 2023-02-20 01:49 出处:网络
The characters «, », ‘, ’ and several others disappear because I specify //TRANSLIT when converting to UTF-8 from Latin-1/CP1251:

The characters «, », , and several others disappear because I specify //TRANSLIT when converting to UTF-8 from Latin-1/CP1251:

iconv -f utf-8 -t latin1//TRANSLIT < in.sql | iconv -f cp1251//TRANSLIT -t utf-8 > out.sql

The gets converted to a ' since it isn't in Latin1. Is there a way to keep the characters somehow intact?

So far I've been manually keeping track and replacing them with CONSTANTSLIKETHIS mapped to letters, and I d开发者_开发技巧o manual vim replacements after the conversion process is done.

0

精彩评论

暂无评论...
验证码 换一张
取 消