473,396 Members | 1,671 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,396 software developers and data experts.

coding: cp1252, coding: windows-1252 stop working

103 100+
OS: windows
Python 3.3.5

I am using characters like 'öÖäÄåÅąĄčČęĘėĖįĮšŠųŲūŪžŽ' in my scripts and adding the script file the first line
Expand|Select|Wrap|Line Numbers
  1. # -*- coding: cp1252 -*-
Currently i start getting the error: "Invalid encoding cp1252" when i try to save the file.
And error "encoding problem: windows1252 with BOM" when i try to run the file.


I also have tried other encodings like:
cp-1252
windows-1252
windows1252

What i can do. How to use characters 'öÖäÄåÅąĄčČęĘėĖįĮšŠųŲūŪžŽ' in my script?
Oct 3 '14 #1

✓ answered by stdq

Hi! I'm not sure, but this might help: try changing your line of code to

Expand|Select|Wrap|Line Numbers
  1. # -*- coding: utf-8 -*-
Also, try changing the file encoding to UTF-8.

3 4123
stdq
94 64KB
Hi! I'm not sure, but this might help: try changing your line of code to

Expand|Select|Wrap|Line Numbers
  1. # -*- coding: utf-8 -*-
Also, try changing the file encoding to UTF-8.
Oct 3 '14 #2
dwblas
626 Expert 512MB
A simple search came up with Mapping Windows CP1252 Gremlins to Unicode so it is almost certain that there are additional sites from people who have already solved this problem. Pick the one you like best as there is no point in reinventing the wheel here.
Oct 3 '14 #3
gintare
103 100+
Thanks stdq. It have helped. I mean the line:
Expand|Select|Wrap|Line Numbers
  1. # -*- coding: utf-8 -*-
Oct 4 '14 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: g | last post by:
Hi, I am using VS 2002 coding against the calendar folder in outlook 2002 with c#. I'm monitoring add and remove of Calendar items. I assign the add event on the calendar folder and watch the...
2
by: Adlai Stevenson | last post by:
Ok, the good news is the last kernel upgrade made bzflag stop working. The bad news is that mplayer, ogle and real player stopped working ! Is anybody in a similar boat? I am using Suse 9.1...
0
by: Adrian Stovold | last post by:
I've written an ASP.NET application in VB.NET. It works fine on all Windows platforms and browsers, but there's a problem on the Mac version of IE (v5.1.5) running on Mac OS 9.2. I can reproduce...
2
by: GGW | last post by:
Hi, I am building a Ecommerce site using usercontrols. I built a search control that uses the Ontextchaged event. The control was place manually on the page- not dynamiclly. All was working fine...
2
by: Martyn Fewtrell | last post by:
Dear All I have a Windows 2003 Server with IIS6 where the validation controls on ASP.Net pages no longer work. I believe it to be specific to the server as if I create an ASP.Net page on the...
7
by: z f | last post by:
Hi, i have a vb.net web application that uses validators. on my dev machine (Xp pro) it works fine. on the hosting machine (win2003) the validator (client side and server side ) stop working....
2
by: chrisexv6 | last post by:
Recently been having an issue pop up with a web service thats been running fine for months. The service in question takes calls from our public web server, then logs data to a database server...
7
by: Daniele Piccinini | last post by:
Hallo, I've writed a C# windows service in VS 2003. This service use a System.Timers.Timer to periodically call some functions of a web service. ( Some of this functions required minutes to be...
3
by: lds | last post by:
On our server we have both applications that have been migrated to use v2.0 of the framework as well as apps that have not yet been migrated and still use 1.1. When I tried to deploy my v2.0 app...
4
by: Adam Tippelt | last post by:
Situation: I'm using a continuous form to display a lot of information stored in a datasheet. I'm using the form because it allows me to display multiple rows of information per 'record' which is...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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.