473,405 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Trouble with source-code encoding

Hi,

I just upgraded to Python2.3 and I'm getting a weird warning complaining about
the encoding and asking me to read a pep. OK, I read the Pep and know what
syntax to specify the enconding:
# -*- coding: <encoding name> -*-

However, th epep doesn't list the name of valid encodings. What's the name
for west european encoding?
Jul 18 '05 #1
3 1646
Fernando Rodriguez wrote:
However, the pep doesn't list the name of valid encodings. What's
the name for west european encoding?


Unfortunately, there is no way, from code, to get a list of valid
encodings.

You can get a good idea of supported encodings, their names and
various aliases, by looking at the source of

Lib/encodings/aliases.py

which gives the following list of possible names for the "latin_1"
codec

'8859'
'cp819'
'csisolatin1'
'ibm819'
'iso8859'
'iso_8859_1'
'iso_8859_1_1987'
'iso_ir_100'
'l1'
'latin'
'latin1'

Any of those should work as your script encoding.

--
alan kennedy
-----------------------------------------------------
check http headers here: http://xhaus.com/headers
email alan: http://xhaus.com/mailto/alan
Jul 18 '05 #2
Fernando Rodriguez <fr*@easyjob.net> writes:
However, th epep doesn't list the name of valid encodings. What's
the name for west european encoding?


There is more than one west european encoding. Most common are
"iso-8859-1" (also known as "latin-1"), "cp1252" (aka "windows-1252"),
and "utf-8".

Regards,
Martin

Jul 18 '05 #3

Fernando> I just upgraded to Python2.3 and I'm getting a weird warning complaining about
Fernando> the encoding and asking me to read a pep. OK, I read the Pep and know what
Fernando> syntax to specify the enconding:
Fernando> # -*- coding: <encoding name> -*-

Fernando> However, th epep doesn't list the name of valid encodings.
Fernando> What's the name for west european encoding?

That would be

# -*- coding: latin1 -*-

or

# -*- coding: iso8859-1 -*-

I believe.

Skip

Jul 18 '05 #4

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

Similar topics

12
by: Bill | last post by:
For my personal use I am accessing a railway timetable page, parsing its contents and then sending brief relevant information as the subject line of an email to be read on a mobile phone. The...
4
by: frankgerlach | last post by:
I am experiencing problems when installing PHP5/MYSQL. I did ./configure --with-mysql=/usr/local/mysql --disable-libxml --with-zlib-dir=/home/frank/zlib-1.2.2 make make install The build...
3
by: Earl Eiland | last post by:
I'm trying to process the IP packet length field, as recorded by pcap (Ethereal) and recovered using pcapy. When I slice out those bytes, I get a value that shows in '\x00' format, rather than...
0
by: Mek | last post by:
Hey Everyone, I am building a store application that is on an unsecured server. We got one of those shared certificates that takes you from (ex. http://www.mydomain.net to...
0
by: Stephen | last post by:
Hi I am having trouble with a third party component that I am attempting to use on our web application (Xceed Graph Component). When I develop locally it all works fine, but as soon as I try to...
1
by: Westbrook, Christopher L (WESTBCL04) | last post by:
I am having some trouble, and I can't figure out why. I'm trying to use the simple keylogger project from source forge, and then create a web interface to open the resulting files, so people from...
0
by: Mike Hildner | last post by:
Hello, I'm attempting to use encryption rather than hashing on a 2.0 site so I can retrieve passwords. I tried just changing from passwordFormat="Hashed" to passwordFormat="Encrypted". Now...
1
by: MLH | last post by:
Am having trouble with the filter property setting below. Would like to filter the listing to car makes beginning with "D". I'm blowing it on the filter spec somehow??? Sub OpenRecordsetX() ...
0
by: Frank_00001 | last post by:
I'm having a little trouble with the 508 Accessibility Compliance, relating labels and with DropDowns, from an XHTML source. 1) When I assign the AssociatedControlID for a label, the width for the...
2
by: Matt F | last post by:
I have a relatively long command that I'm attempting to get process.start to execute. When executing the command, I get a "The system cannot find the file specified" error. I've gone to the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
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 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.