Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id CDB8BF6332A; Thu, 19 Jul 2012 03:38:10 -0300 (ADT) Received: from mail-lb0-f174.google.com ([209.85.217.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SrkNE-0005cH-2j; Thu, 19 Jul 2012 06:38:10 +0000 Received: by lbbgm6 with SMTP id gm6so3154726lbb.19 for ; Wed, 18 Jul 2012 23:37:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=DNalHy16ghVWdaWSRAzgz1Yv051YtsFrVmCojFIi2dg=; b=LCdj6fMxyvioxKzShWjdLwCoqXGB6lDsO6GzL314JipjQbih9jN0J6F7DzK7KxK4I5 QNw/P59sHP1jphhl3bJ9M8Wr0+Bq2HGfS8dem3MfrGD+loAgakQ88BR921wQ6V0vSUEI Kb9F5PLgNiOKgdYekG2PTxS+3jzP7Nr7xiEJ65znbqGFb3v8DkJ70NwxHPgIVaZcY1wO pRJc03apbIidh7Lu084XcN/gXcei1Xln7Z/Ju1BwORyHUJ4AWBqEKhsSquw8FGQ8Smub SCVgGvcUtGOFyctm7paWhWSgd1pkBvHZdF2yi9m1ie9bkgBWwRWpCxzLNJ8nGHyPolrZ Fzsg== Received: by 10.152.131.37 with SMTP id oj5mr696866lab.14.1342679874402; Wed, 18 Jul 2012 23:37:54 -0700 (PDT) Received: from [1.0.0.7] ([94.138.26.200]) by mx.google.com with ESMTPS id hz16sm1172141lab.6.2012.07.18.23.37.51 (version=SSLv3 cipher=OTHER); Wed, 18 Jul 2012 23:37:52 -0700 (PDT) Message-ID: <5007AB3D.3010501@gmail.com> Date: Thu, 19 Jul 2012 10:37:49 +0400 From: Alexander Law User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Tatsuo Ishii CC: pgsql-general@postgresql.org, ringerc@ringerc.id.au, yi.codeplayer@gmail.com, pgsql-bugs@postgresql.org Subject: Re: main log encoding problem References: <1332187409-sup-4631@alvh.no-ip.org> <50067916.8010508@gmail.com> <5006D340.4000808@gmail.com> <20120719.081626.240539691760651172.t-ishii@sraoss.co.jp> In-Reply-To: <20120719.081626.240539691760651172.t-ishii@sraoss.co.jp> Content-Type: multipart/alternative; boundary="------------050801040001030402020206" X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201207/155 X-Sequence-Number: 33631 This is a multi-part message in MIME format. --------------050801040001030402020206 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello, >> C. We have one logfile with UTF-8. >> Pros: Log messages of all our clients can fit in it. We can use any >> generic editor/viewer to open it. >> Nothing changes for Linux (and other OSes with UTF-8 encoding). >> Cons: All the strings written to log file should go through some >> conversation function. >> >> I think that the last solution is the solution. What is your opinion? > I am thinking about variant of C. > > Problem with C is, converting from other encoding to UTF-8 is not > cheap because it requires huge conversion tables. This may be a > serious problem with busy server. Also it is possible some information > is lossed while in this conversion. This is because there's no > gualntee that there is one-to-one-mapping between UTF-8 and other > encodings. Other problem with UTF-8 is, you have to choose *one* > locale when using your editor. This may or may not affect handling of > string in your editor. > > My idea is using mule-internal encoding for the log file instead of > UTF-8. There are several advantages: > > 1) Converion to mule-internal encoding is cheap because no conversion > table is required. Also no information loss happens in this > conversion. > > 2) Mule-internal encoding can be handled by emacs, one of the most > popular editors in the world. > > 3) No need to worry about locale. Mule-internal encoding has enough > information about language. > -- > I believe that postgres has such conversion functions anyway. And they used for data conversion when we have clients (and databases) with different encodings. So if they can be used for data, why not to use them for relatively little amount of log messages? And regarding mule internal encoding - reading about Mule http://www.emacswiki.org/emacs/UnicodeEncoding I found: /In future (probably Emacs 22), Mule will use an internal encoding which is a UTF-8 encoding of a superset of Unicode. / So I still see UTF-8 as a common denominator for all the encodings. I am not aware of any characters absent in Unicode. Can you please provide some examples of these that can results in lossy conversion? ?hoosing UTF-8 in a viewer/editor is no big deal too. Most of them detect UTF-8 automagically, and for the others BOM can be added. Best regards, Aexander --------------050801040001030402020206 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
Hello,

C. We have one logfile with UTF-8.
Pros: Log messages of all our clients can fit in it. We can use any
generic editor/viewer to open it.
Nothing changes for Linux (and other OSes with UTF-8 encoding).
Cons: All the strings written to log file should go through some
conversation function.

I think that the last solution is the solution. What is your opinion?
I am thinking about variant of C.

Problem with C is, converting from other encoding to UTF-8 is not
cheap because it requires huge conversion tables. This may be a
serious problem with busy server. Also it is possible some information
is lossed while in this conversion. This is because there's no
gualntee that there is one-to-one-mapping between UTF-8 and other
encodings. Other problem with UTF-8 is, you have to choose *one*
locale when using your editor. This may or may not affect handling of
string in your editor.

My idea is using mule-internal encoding for the log file instead of
UTF-8. There are several advantages:

1) Converion to mule-internal encoding is cheap because no conversion
   table is required. Also no information loss happens in this
   conversion.

2) Mule-internal encoding can be handled by emacs, one of the most
   popular editors in the world.

3) No need to worry about locale. Mule-internal encoding has enough
   information about language.
--

I believe that postgres has such conversion functions anyway. And they used for data conversion when we have clients (and databases) with different encodings. So if they can be used for data, why not to use them for relatively little amount of log messages?
And regarding mule internal encoding - reading about Mule http://www.emacswiki.org/emacs/UnicodeEncoding I found:
In future (probably Emacs 22), Mule will use an internal encoding which is a UTF-8 encoding of a superset of Unicode.
So I still see UTF-8 as a common denominator for all the encodings.
I am not aware of any characters absent in Unicode. Can you please provide some examples of these that can results in lossy conversion?
Сhoosing UTF-8 in a viewer/editor is no big deal too. Most of them detect UTF-8 automagically, and for the others BOM can be added.

Best regards,
Aexander
--------------050801040001030402020206--