$ python
Python 2.4.1 (#1, May 16 2005, 15:19:29)
[GCC 4.0.0 20050512 (Red Hat 4.0.0-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information. import codecs codecs.lookup('ascii')
(<built-in function ascii_encode>, <built-in function ascii_decode>,
<class encodings.ascii.StreamReader at 0xb7f1302c>, <class
encodings.ascii.StreamWriter at 0xb7f82fbc>) codecs.lookup('mbcs')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/encodings/__init__.py", line 96, in
search_function
globals(), locals(), _import_tail)
File "/usr/lib/python2.4/encodings/mbcs.py", line 14, in ?
class Codec(codecs.Codec):
File "/usr/lib/python2.4/encodings/mbcs.py", line 18, in Codec
encode = codecs.mbcs_encode
AttributeError: 'module' object has no attribute 'mbcs_encode' codecs.lookup('tactis')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
LookupError: unknown encoding: tactis 3 1901
I don't know what 'tactis' is, but 'mbcs' is not a portable character set name.
It's a special character set name on win32, which refers to some system-specific
multibyte character set.
I don't think these "failures" are a Python bug.
Jeff
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
iD8DBQFC8itgJd01MZaTXX0RAsCXAJ9putcYKQmJh0JtEpz3t5 5ZJUw8WgCeNeVo
45dOp2LG6mfqQ2jw+4yHUoQ=
=JqsK
-----END PGP SIGNATURE-----
<je****@unpythonic.net> wrote in message
news:ma***************************************@pyt hon.org... I don't know what 'tactis' is, but 'mbcs' is not a portable character set name. It's a special character set name on win32, which refers to some system-specific multibyte character set.
I don't think these "failures" are a Python bug.
I suppose, for consistency, it should ideally raise LookupError, though
On Thu, Aug 04, 2005 at 03:59:01PM +0100, Richard Brodie wrote: I suppose, for consistency, it should ideally raise LookupError, though
Maybe so. If that was the poster's point, then I completely missed it.
Jeff
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
iD8DBQFC8kXcJd01MZaTXX0RAq23AJ9jjXX2kqSUtxdm6JagR5 o6Av8duQCeOEbD
5mK5Ynnx4M8E21sDpHUfLVA=
=/iJo
-----END PGP SIGNATURE----- This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Edward K. Ream |
last post by:
Am I reading pep 277 correctly? On Windows NT/XP, should filenames always
be converted to Unicode using the mbcs encoding? For example,
myFile = unicode(__file__, "mbcs", "strict")
This...
|
by: Marko Faldix |
last post by:
Hello,
with Python 2.3 I can write umlauts (a,o,u umlaut) to a file with this piece
of code:
import codecs
f = codecs.open("klotentest.txt", "w", "latin-1")
print >>f, unicode("My umlauts...
|
by: Fortepianissimo |
last post by:
I'd like to decode some email headers into unicode, including some
Asian DBCS. I've searched several places and they pointed to the
Python Codecs project @ SF...
|
by: Eric Brunel |
last post by:
Hi all,
I just found a problem in the xreadlines method/module when used with codecs.open: the codec specified in the open does not seem to be taken into account by xreadlines which also returns...
|
by: Ivan Van Laningham |
last post by:
Hi All--
As far as I can tell, after looking only at the documentation (and not
searching peps etc.), you cannot query the codecs to give you a list of
registered codecs, or a list of possible...
|
by: TK |
last post by:
Hi there,
sys.stdout = codecs.lookup('utf-8')(sys.stdout)
What does this line mean?
Thanks.
o-o
|
by: Mike Currie |
last post by:
I'm trying to write out files that have utf-8 characters 0x85 and 0x08 in
them. Every configuration I try I get a UnicodeError: ascii codec can't
decode byte 0x85 in position 255: oridinal not in...
|
by: Bit Byte |
last post by:
I am working on a large project and have several modules written
compiled using MBCS. I am considering purchasing a third party library
which I understand, is compiled to support unicode strings.
...
|
by: yrogirg |
last post by:
Actually, I need utf-8 to utf-8 encoding which would change the text
to another keyboard layout (e.g. from english to russian ghbdtn ->
привет) and would not affect other symbols.
I`m totally...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |