Unicode Problem

Roland Smith rsmith at xs4all.nl
Thu Jan 29 07:30:22 UTC 2015


On Thu, Jan 29, 2015 at 01:38:21AM -0500, Robert Simmons wrote:
> I'm having a unicode problem on FreeBSD lang/python34 that does not
> appear on MacOS X. I've condensed the problem to one single line to
> enter in the interpreter:
> 
> FreeBSD:
> Python 3.4.2 (default, Jan 28 2015, 22:23:57)
> [GCC 4.2.1 Compatible FreeBSD Clang 3.4.1 (tags/RELEASE_34/dot1-final
> 208032)] on freebsd10
> Type "help", "copyright", "credits" or "license" for more information.
> >>> b'\xc3\xa2'.decode('utf-8')
> '\xe2'
> 
> MacOS X:
> Python 3.4.2 (default, Oct 19 2014, 17:55:38)
> [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.54)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> b'\xc3\xa2'.decode('utf-8')
> 'â'
> 
> Why is Python on FreeBSD incorrectly decoding this?

Works fine here (FreeBSD 10.1-STABLE #0 r276653 amd64):

    Python 3.4.2 (default, Nov  4 2014, 19:34:48)
    [GCC 4.2.1 Compatible FreeBSD Clang 3.4.1 (tags/RELEASE_34/dot1-final 208032)] on freebsd10
    Type "help", "copyright", "credits" or "license" for more information.
    >>> b'\xc3\xa2'.decode('utf-8')
    'â'


Roland
-- 
R.F.Smith                                   http://rsmith.home.xs4all.nl/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 5753 3324 1661 B0FE 8D93  FCED 40F6 D5DC A38A 33E0 (keyID: A38A33E0)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-python/attachments/20150129/f9f3fe74/attachment.sig>


More information about the freebsd-python mailing list