Answer the question
In order to leave comments, you need to log in
How to convert cp866 strings encoded in latin1 to unicode?
I am transferring the FIAS database to the mysql database.
The trick is this. Databases are available for download in xml or dbf (I hope someone else remembers what it is?) I
thought I chose dbf. Because it's not at all clear what to do with xml, and there is a dbf2mysql utility for dbf
Everything would be fine if not for:
1. The author of the utility, it seems, never thought that someone might need encodings other than latin1
2. Itself base (dbf) in the good old lamp cp866
3. My mysql - in utf8
Total we have. The cp866 strings interpreted by the utility as latin1 are driven into utf8 tables
Question: how to do it like a human?
Merge the dump with forced latin1 and manually distill it first into cp866, and then I tried it into Unicode. But, firstly, the base is impossibly large. Every time you drive back and forth dumps - it's easier to shoot yourself. And, secondly, during such operations, characters in upper case are lost. (Instead of them appears "?").
Logic suggests that you need to overtake the fields into a blob, and then back into varchar with a different encoding, and so on several times. But for some reason it doesn't work.
Suggest options.
Thanks in advance.
Answer the question
In order to leave comments, you need to log in
When I solved such a problem, I realized that the easiest way is to write a miniconverter. It took much less time than searching for ready-made solutions.
base in utf? tables in utf? connection in utf? somewhere necessarily latin yes will come out
dev.mysql.com/doc/refman/5.0/en/charset-convert.html
Can it help?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question