Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #100013

Unicode failure

From "D'Arcy J.M. Cain" <darcy@VybeNetworks.com>
Newsgroups comp.lang.python
Subject Unicode failure
Date 2015-12-04 13:07 -0500
Organization Vybe Networks Inc.
Message-ID <mailman.205.1449268365.14615.python-list@python.org> (permalink)

Show all headers | View raw


I thought that going to Python 3.4 would solve my Unicode issues but it
seems I still don't understand this stuff.  Here is my script.

#! /usr/bin/python3
# -*- coding: UTF-8 -*-
import sys 
print(sys.getdefaultencoding()) 
print(u"\N{TRADE MARK SIGN}") 

And here is my output.

utf-8
Traceback (most recent call last):
  File "./g", line 5, in <module>
    print(u"\N{TRADE MARK SIGN}")
UnicodeEncodeError: 'ascii' codec can't encode character '\u2122' in
position 0: ordinal not in range(128)

What am I missing?

TIA.

-- 
D'Arcy J.M. Cain
Vybe Networks Inc.
http://www.VybeNetworks.com/
IM:darcy@Vex.Net VoIP: sip:darcy@VybeNetworks.com

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Unicode failure "D'Arcy J.M. Cain" <darcy@VybeNetworks.com> - 2015-12-04 13:07 -0500
  Re: Unicode failure Dave Farrance <df@see.replyto.invalid> - 2015-12-06 09:06 +0000
    Re: Unicode failure Dave Farrance <df@see.replyto.invalid> - 2015-12-06 09:16 +0000
    Re: Unicode failure Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-12-06 09:34 +0000
    Re: Unicode failure Random832 <random832@fastmail.com> - 2015-12-06 15:36 -0500
  Re: Unicode failure Quivis <quivis@domain.invalid> - 2015-12-06 23:09 +0000
    Re: Unicode failure Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2015-12-07 10:48 +0000

csiph-web