R
R
Rampage_Masta2015-01-22 16:42:46
MySQL
Rampage_Masta, 2015-01-22 16:42:46

MySQL and Doubly-encoded to UTF-8 from CP1251, how to read data?

There is a string that is double encoded via in CP1251.
How to SELECT'om display the encoded string if the DB encoding is utf8_general_ci?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rampage_Masta, 2015-01-23
@Rampage_Masta

You probably won't be able to do this with database tools.

It will turn out.
select CONVERT(CAST(CONVERT(CONVERT(CAST(CONVERT('P ЎРµСЂРµРЅРµРІРµРЅСЊРєРС'Р в„–' USING cp1251) AS BINARY) USING utf8) USING cp1251) AS BINARY) USING utf8);
which is the same as
cat text | iconv -f utf8 -t cp1251 | iconv -f utf8 -t cp1251

M
mayorovp, 2015-01-23
@mayorovp

We need to recode them back, obviously. You probably won't be able to do this with database tools.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question