From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.50) id 1EZ8Ej-0005NX-8Q for garchives@archives.gentoo.org; Mon, 07 Nov 2005 14:44:41 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.5/8.13.5) with SMTP id jA7EhjHb019460; Mon, 7 Nov 2005 14:43:45 GMT Received: from gabriel.sub.uni-goettingen.de (gabriel.sub.uni-goettingen.de [134.76.163.126]) by robin.gentoo.org (8.13.5/8.13.5) with ESMTP id jA7Edu53013644 for ; Mon, 7 Nov 2005 14:39:56 GMT Received: by gabriel.sub.uni-goettingen.de (Postfix, from userid 8) id 45A0B8DCC4; Mon, 7 Nov 2005 15:39:56 +0100 (CET) Received: from sub00421 (unknown [134.76.161.221]) by gabriel.sub.uni-goettingen.de (Postfix) with ESMTP id 3F0088DCC1 for ; Mon, 7 Nov 2005 15:39:55 +0100 (CET) Date: Mon, 7 Nov 2005 15:39:54 +0100 From: Hans-Werner Hilse To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Convert windows-1250 database to UTF-8 Message-Id: <20051107153954.2a4a89e4.hilse@web.de> In-Reply-To: <436F39A2.8000706@lsinter.net> References: <436F358F.8060908@lsinter.net> <436F39A2.8000706@lsinter.net> X-Mailer: Sylpheed version 2.1.4 (GTK+ 2.8.6; i586-pc-linux-gnu) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Details: No, hits=0.0 required=5.0 tests=AWL autolearn=ham version=2.64 X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on gabriel.sub.uni-goettingen.de X-Archives-Salt: af6f1165-3348-489e-bd18-f4de32021a7d X-Archives-Hash: d1b60e2ed5c6a2396e5c2bf647fd3868 Hi, On Mon, 07 Nov 2005 12:25:22 +0100 Khan wrote: > Bruno Lustosa wrote: > > On 11/7/05, *Khan* > wrote: > > > > I'm trying to convert my windows-1250 database to Unicode, UTF-8. Is > > there any script that can do the job? > > > > What kind of database is it? > > If it's something the likes of postgresql or mysql, you could dump the > > database to a text file, use recode or iconv to change the file > > encoding, and then import it into a new unicode database. > > Yes, that's just what I want to do. Database is MySQL. Can you PLS > explain procedure, I have never done that before. $ mysqldump -u root -p MyDataBase | iconv -f WINDOWS-1250 -t UTF-8 > mydump.sql But beware, this might have big influence or lead to an application not working anymore depending on the assumptions that application makes. E.g., for some of my PHP applications store serialized data in dedicated fields. This depends on the binary content of those fields not being modified due to string length information stored within those fields. When converting to UTF-8, the multi byte sequences would corrupt each of these serialized strings. If I were to convert this to another charset, I had to do it programmatically by using functions of the application, not the DB itself. -hwh -- gentoo-user@gentoo.org mailing list