473,473 Members | 1,847 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Enumerate registered codecs

I see the list of standard encodings in Python 2.4.1 documentation
section 4.9.2.

Is there a method to enumerate the registered codecs at runtime?
Jul 31 '05 #1
3 1537
Paul Watson wrote:
I see the list of standard encodings in Python 2.4.1 documentation
section 4.9.2.

Is there a method to enumerate the registered codecs at runtime?


This has been asked before, within the last couple of months AFAIR. Use
Google to search for codec(s) in this newsgroup in Google groups.

Basically the answer was no. What's your use case?

Jul 31 '05 #2
John Machin wrote:
Paul Watson wrote:
I see the list of standard encodings in Python 2.4.1 documentation
section 4.9.2.

Is there a method to enumerate the registered codecs at runtime?


This has been asked before, within the last couple of months AFAIR. Use
Google to search for codec(s) in this newsgroup in Google groups.

Basically the answer was no. What's your use case?


I need to report the encodings supported. When the user does not enter
a required encoding or enters an invalid encoding, we need to tell them
which encodings are valid and how they are specified. In an embedded
environment I would be concerned that some or most might have been left
out to save space/size/time.

The primary identifier and a descriptive string (localized) need to be
available at a minimum. Having aliases would be a plus.
Aug 1 '05 #3
Paul Watson wrote:
The primary identifier and a descriptive string (localized) need to be
available at a minimum. Having aliases would be a plus.


You will have to implement your own list. Getting the well-known aliases
is possible through encodings.aliases, but a localized descriptive
string was never part of the design - this is something the application
will have to provide.

Regards,
Martin
Aug 1 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Pierre Rouleau | last post by:
Hi all, When building a exe for a Python application under Windows XP with The McMillan installer, the insttaltion succeeds but when I run the resulting executable the application tracebacks...
5
by: Pekka Niiranen | last post by:
Hi, I have Perl code looping thru lines in the file: line: while (<INFILE>) { ... $_ = do something ... if (/#START/) { # Start inner loop
3
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...
3
by: Paul Watson | last post by:
$ python Python 2.4.1 (#1, May 16 2005, 15:19:29) on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import codecs >>> codecs.lookup('ascii') (<built-in...
1
by: Zhongjian Lu | last post by:
Hi Guys, I was processing a UTF-16 coded file with BOM and was not aware of the codecs package at first. I wrote the following code: ===== Code 1============================ for i in...
7
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...
1
by: David Hughes | last post by:
I used this function successfully with Python 2.4 to alter the encoding of a set of database records from latin-1 to utf-8, but the same program raises an exception using Python 2.5. This small...
0
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...
2
by: George Sakkis | last post by:
I'm trying to use codecs.open() and I see two issues when I pass encoding='utf8': 1) Newlines are hardcoded to LINEFEED (ascii 10) instead of the platform-specific byte(s). import codecs f =...
0
marktang
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,...
0
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...
0
Oralloy
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,...
0
jinu1996
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.