Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feed.xsnews.nl!border-1.ams.xsnews.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.022 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'subject:Python': 0.05; '(it': 0.09; 'gettext': 0.09; 'subject:problems': 0.09; 'cc:addr :python-list': 0.10; 'distinction': 0.16; 'emulator': 0.16; 'received:209.85.210.42': 0.16; 'subject:3.3': 0.16; 'subject:Unicode': 0.16; 'test.': 0.17; 'variable': 0.20; 'suggested': 0.20; 'trying': 0.21; 'latter': 0.22; 'uses.': 0.22; 'cc:2**0': 0.23; 'seems': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'prints': 0.29; 'separated': 0.29; 'skip:& 10': 0.29; 'problem.': 0.32; 'problem': 0.33; 'skip:& 20': 0.33; 'agree': 0.34; 'received:google.com': 0.34; 'thanks': 0.34; 'received:209.85': 0.35; 'really': 0.36; 'but': 0.36; "didn't": 0.36; 'should': 0.36; 'thank': 0.36; 'correctly': 0.37; 'skip:v 20': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'application': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'skip:u 10': 0.60; 'subject:, ': 0.61; 'first': 0.61; 'national': 0.61; 'different': 0.63; 'response.': 0.67; 'attention': 0.75; 'isolated': 0.84; 'tough,': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=5uJ1rhRfh0ew0ZyiIUypBxZmgbSwZ+Rk9Xp9iB4YE6Y=; b=wWGYqYlcj+Uqi2RXVz/k0VFyF67IoiG+uaoMJVsplBf3W60R4QshRpR9aVAe1M1t+j edOXHf9CHfgnBStKl+/ooPAionqE9KWpx0cnSx8s4xoePT0Avz7uUoooVTxTO48OGE8X qMAKEESbSlrTSCR36uVzZD6fAthQzroQcD2NHJOiZomHgpILfU51yzM98Hn/uCIotamY 6NVSi3gYdVQ2UgZxJJg9ryit+LddSm9TvNgexeiFlm5YQxWjzqA2lc2nqKTfEyWgJWI2 Jzf8yUHxvIUdV3ktzJXusFEBawXXbdbMbVzSfmfp0RnUqW3/OYbkzng10pW9NIbMohxt GUKA== MIME-Version: 1.0 In-Reply-To: References: Date: Mon, 31 Dec 2012 00:45:33 -0200 Subject: Re: Python 3.3, gettext and Unicode problems From: Marcel Rodrigues To: Terry Reedy Content-Type: multipart/alternative; boundary=047d7b15ae8dd9d00904d21d01ac Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 43 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1356921942 news.xs4all.nl 6904 [2001:888:2000:d::a6]:37156 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:35830 --047d7b15ae8dd9d00904d21d01ac Content-Type: text/plain; charset=UTF-8 Thank you Terry! I was trying to follow the documentation but somehow didn't payed attention to the lgettext/gettext distinction until I read your first response. Changing lgettext to gettext solved the problem. It prints correctly to my console because I have to environmental variable PYTHONIOENCODING set to utf8, which is what my console emulator uses. But that's actually not necessary in my original application (it has a web interface), just for this isolated test. I really should have separated the call to print() as you suggested tough, if only to make the problem clearer. As for the "multiple different limited national encodings" vs "everything as UTF-8", I agree with you and am definitely going for the latter because the former seems to be unnecessarily complicated. Thanks again for the help! Problem solved. --047d7b15ae8dd9d00904d21d01ac Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thank you Terry!

I was trying to follow the documentatio= n but somehow didn't payed attention to the lgettext/gettext distinctio= n until I read your first response. Changing lgettext to gettext solved the= problem.

It prints correctly to my console because I have to env= ironmental variable=C2=A0PYTHONIOENCODING set to utf8, which is what my con= sole emulator uses. But that's actually not necessary in my original ap= plication (it has a web interface), just for this isolated test. I really s= hould have separated the call to print() as you suggested tough, if only to= make the problem clearer.

As for the "multiple=C2=A0different limited nation= al encodings" vs "everything as UTF-8", I agree with you and= am definitely going for the latter because the former seems to be unnecess= arily complicated.

Thanks again for the help! Problem solved.
--047d7b15ae8dd9d00904d21d01ac--