Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 627B09FB6A3 for ; Fri, 4 May 2007 14:12:18 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 16704-09 for ; Fri, 4 May 2007 14:12:10 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.179]) by postgresql.org (Postfix) with ESMTP id DA6299FB684 for ; Fri, 4 May 2007 14:12:10 -0300 (ADT) Received: by py-out-1112.google.com with SMTP id a73so767783pye for ; Fri, 04 May 2007 10:12:10 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=RFtbAvRt699P7zY14m8KkJ0sgVxTyoygP2u+ttrbAQ+77+y4BCQS7HB+u/6mCxzRlTOSMC9R/g/lMwhJiiBd73l/7Od7n9Gq0f3SCcdwRHp8IEEcACWvlV0kUxdtiYkl9mCWK8h5ETfGglwfM+LGTnCgn4jFq9s+cGZ7UDFrWwY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=CNuAIc4hSY/V/7F6dbzTaG1rxt3tLB+7C4O8JXAOJCjfKqV8HaX8kyYDdsK2/BZj0J3bFoxG2M/rqFJu2he0Vk3WdQwsL0dlZCCvb6iEfcXtMwmpUtMx13xWTZp5mEYenMcBainLe3SW2WlQeO3WNBgjs3NOMFBrxrlI3s6Xkvk= Received: by 10.35.8.1 with SMTP id l1mr1506879pyi.1178298729786; Fri, 04 May 2007 10:12:09 -0700 (PDT) Received: by 10.35.85.17 with HTTP; Fri, 4 May 2007 10:12:09 -0700 (PDT) Message-ID: Date: Fri, 4 May 2007 20:12:09 +0300 From: "Adrian Maier" To: "Elim Qiu" Subject: Re: multi-language web application: is it possible? Cc: pgsql-www@postgresql.org In-Reply-To: <01ce01c78e57$5a071120$6400a8c0@grace> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <01ce01c78e57$5a071120$6400a8c0@grace> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/36 X-Sequence-Number: 11970 On 5/4/07, Elim Qiu wrote: > > I have many tables like the table Person:below, in mysql database. > > person_id, first_name,last_name, mi, gb_first_name, gb_last_name, > b5_first_name, b5_last_name, gender, dob > > where different columns storing strings in different encodings. At anytime, > a web user can switch the language and the application will get the values > in the right columns to generate web pages. The purpose of Multi-language > tables is to make multilanguage dynamic content management easier for web > applications. For example, to add a person record, the user enter the > English name, then switch the session language to gb2312, enter the Chinese > name in gb2312, and then switch the session language to big5, enter the name > in big5. And then commit the data into the database. The whole thing sounds > complicated but can be treated as a pattern and let a framework to take care > of those and the code can be as clean as a single language app. I actually > have the framework that works well for me with mysql database. > > I'm trying to port the app to pgsql database but got trouble doing so. I can > read and set a row with multiple languages (in some paricular cases), but > cannot do queries like (gb_first_name = 'A' and b5_first_name = 'B') with A > a gb2312 string, B a big5 string. The tables are of unicode encoded, and the > dbclient encoding is set to GBK. The application's char set are selectable > by user among iso-8859-1,gb2312 and big5. > > I didn't do anything about language encoding in mysql database, it just > worked for me. At least with english, gb2312 and big5 altogether in a table > like table Person above. I noticed that (english, gb2312, big5, Jp) cannot > work together even in mysql database. My approach seems fine with most > western languages > > So after all such experimental work, I still don't know how to make a real > multi language web app such that the languages are switchable within the > same session. > > Any suggestions? Any web application known to be able to solve the problem? > Thanks Elim, the pgsql-www mailing list is dedicated to discussions regarding the PostgreSQL website , and not to discussions about developing web applications. I've noticed that you've sent the email to pgsql-general as well . pgsql-general is probably a better place for asking your question . Best wishes, Adrian Maier