Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jan 2015 20:32:35 +1100
From:      Kubilay Kocak <koobs@FreeBSD.org>
To:        Robert Simmons <rsimmons0@gmail.com>
Cc:        freebsd-python@freebsd.org
Subject:   Re: Unicode Problem
Message-ID:  <54C9FE33.2070307@FreeBSD.org>
In-Reply-To: <CA%2BQLa9Amvu%2B1hg4Oo5J_CjoJNF2Ahs6LAkPrOAEncNU_iWXEtQ@mail.gmail.com>
References:  <CA%2BQLa9DnD4mYSBc3B_SUZ6shH64v8Lej_CMMVaK=s%2BPrQp5Gvw@mail.gmail.com> <CA%2BQLa9Amvu%2B1hg4Oo5J_CjoJNF2Ahs6LAkPrOAEncNU_iWXEtQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 29/01/2015 6:13 PM, Robert Simmons wrote:
> On further inspection I've found the following:
> 
> FreeBSD
>>>> import sys
>>>> print(sys.getdefaultencoding())
> utf-8
>>>> print(sys.stdout.encoding)
> US-ASCII
> 
> MacOS X:
>>>> import sys
>>>> print(sys.getdefaultencoding())
> utf-8
>>>> print(sys.stdout.encoding)
> UTF-8
> 
> How do I modify stdout encoding to set it to UTF-8 in FreeBSD?

Another data point from my 9-STABLE:

Python 3.4.2 (default, Nov  3 2014, 13:38:18)
[GCC 4.2.1 Compatible FreeBSD Clang 3.4.1 (tags/RELEASE_34/dot1-final
208032)] on freebsd9
Type "help", "copyright", "credits" or "license" for more information.
>>> b'\xc3\xa2'.decode('utf-8')
'รข'
>>> import sys
>>> print(sys.getdefaultencoding())
utf-8
>>> print(sys.stdout.encoding)
UTF-8
>>>

Python 2.7.9 (default, Jan 24 2015, 20:39:40)
[GCC 4.2.1 Compatible FreeBSD Clang 3.4.1 (tags/RELEASE_34/dot1-final
208032)] on freebsd9
Type "help", "copyright", "credits" or "license" for more information.
>>> b'\xc3\xa2'.decode('utf-8')
u'\xe2'
>>> import sys
>>> print(sys.getdefaultencoding())
ascii
>>> print(sys.stdout.encoding)
UTF-8
>>>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54C9FE33.2070307>