Gentoo Archives: gentoo-user

From: Hans-Werner Hilse <hilse@×××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Convert windows-1250 database to UTF-8
Date: Mon, 07 Nov 2005 14:44:41
Message-Id: 20051107153954.2a4a89e4.hilse@web.de
In Reply to: Re: [gentoo-user] Convert windows-1250 database to UTF-8 by Khan
1 Hi,
2
3 On Mon, 07 Nov 2005 12:25:22 +0100
4 Khan <nbv.sa@×××××××.net> wrote:
5
6 > Bruno Lustosa wrote:
7 > > On 11/7/05, *Khan* <nbv.sa@×××××××.net <mailto:nbv.sa@×××××××.net>> wrote:
8 > >
9 > > I'm trying to convert my windows-1250 database to Unicode, UTF-8. Is
10 > > there any script that can do the job?
11 > >
12 > > What kind of database is it?
13 > > If it's something the likes of postgresql or mysql, you could dump the
14 > > database to a text file, use recode or iconv to change the file
15 > > encoding, and then import it into a new unicode database.
16 >
17 > Yes, that's just what I want to do. Database is MySQL. Can you PLS
18 > explain procedure, I have never done that before.
19
20 $ mysqldump -u root -p MyDataBase | iconv -f WINDOWS-1250 -t UTF-8 > mydump.sql
21
22 But beware, this might have big influence or lead to an application not
23 working anymore depending on the assumptions that application makes.
24
25 E.g., for some of my PHP applications store serialized data in
26 dedicated fields. This depends on the binary content of those fields
27 not being modified due to string length information stored within those
28 fields. When converting to UTF-8, the multi byte sequences would
29 corrupt each of these serialized strings. If I were to convert this to
30 another charset, I had to do it programmatically by using functions of
31 the application, not the DB itself.
32
33 -hwh
34 --
35 gentoo-user@g.o mailing list