Questions tagged [cp1252]

CP-1252 or Windows-1252 is a character encoding of the Latin alphabet.

The windows 1252 codepage is used by the windows operating system to display a number of latin based languages. This character set mimics the ISO 8859-1 (Latin-1) character set, except it varies with the characters in positions in the range of 128-159.

The set of languages represented by CP1252 include English, Spanish, and various Germanic/Scandinavian languages.

125 questions
47
votes
1 answer

Why does Eclipse use Cp1252 encoding?

Apologies if this is a very amateurish question! I know Eclipse uses Cp1252 as the default for its encoding. I recently created a program using hash maps to convert letters input to Braille. To do this, I had to change the encoding method to UTF-8. …
Andrew Martin
  • 5,619
  • 10
  • 54
  • 92
42
votes
3 answers

Correctly reading text from Windows-1252(cp1252) file in python

so okay, as the title suggests the problem I have is with correctly reading input from a windows-1252 encoded file in python and inserting said input into SQLAlchemy-MySql table. The current system setup: Windows 7 VM with "Roger Access Control…
Krisjanis Zvaigzne
  • 495
  • 1
  • 6
  • 7
26
votes
8 answers

How to use Special Chars in Java/Eclipse

How can I use/display characters like ♥, ♦, ♣, or ♠ in Java/Eclipse? When I try to use them directly, e.g. in the source code, Eclipse cannot save the file. What can I do? Edit: How can I find the unicode escape sequence?
Burkhard
  • 14,596
  • 22
  • 87
  • 108
23
votes
2 answers

What characters do not directly map from Cp1252 to UTF-8?

I've read in several stackoverflow answers that some characters do not directly map (or are even "unmappable") when converting from Cp1252 (aka Windows-1252; they're the same, aren't they?) to UTF-8, e.g. here:…
Christian
  • 6,070
  • 11
  • 53
  • 103
22
votes
5 answers

Java, Ant error: unmappable character for encoding Cp1252

I am using Java, Eclipse and Ant in my project. I had some Java code that I needed to edit and add some UTF-8 chars in them. Previously my build.xml had: And it worked fine. Now after adding those UTF-8 chars when I try to run, it throws "error:…
user2666282
  • 381
  • 1
  • 2
  • 15
10
votes
5 answers

Encoding cp1252

When I try the following in Java: System.out.println(System.getProperty("file.encoding")); I get cp1252 as the encoding. Is there a way to know where this value is coming from? (Like Environment variables or something) I would like to print the…
Arun
  • 101
  • 1
  • 1
  • 3
6
votes
1 answer

How do I convert unicode string with cp1252 characters into UTF-8 with Python?

I am getting text through an API that returns characters with a windows encoded apostrophe (\x92): > python >>> title = u'There\x92s thirty days in June' >>> title u'There\x92s thirty days in June' >>> print title Theres thirty days in June >>>…
ninapavlich
  • 739
  • 2
  • 10
  • 30
6
votes
3 answers

Python 3 chokes on CP-1252/ANSI reading

I'm working on a series of parsers where I get a bunch of tracebacks from my unit tests like: File "c:\Python31\lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError:…
Aaron Altman
  • 1,705
  • 1
  • 14
  • 22
5
votes
3 answers

How to decode cp1252 which is in decimal “ instead of \x93?

I am getting the source code of a webpage and the encoding is cp1252. Chrome displays the page correctly. Here is my code: import sys from urllib.request import urlopen from bs4 import BeautifulSoup, UnicodeDammit import re import codecs url =…
Lazik
  • 2,480
  • 2
  • 25
  • 31
4
votes
4 answers

Bulk convert cp1252 to utf-8 in Windows

So, I've been trying to convert a large java source tree from cp1252 to UTF-8 in Windows, using tips and trix I've found online, specificly here. Problem is, I'm on Windows; I don't do VB; Cygwin's iconv doesn't take the -o switch. The line I first…
Larsing
  • 171
  • 4
  • 13
4
votes
2 answers

Character encoding in Excel spreadsheet (and what Java charset to use to decode it)

I am using the JExcel library to read excel spreadsheets. Each cell on the spreadsheet may contain localization strings in any of something like 44 languages (English, Portugese, French, Chinese, etc). Today I don't tell the API anything regarding…
Bob Kuhar
  • 10,838
  • 11
  • 62
  • 115
4
votes
1 answer

Every time I start/restart Eclipse it changes the Text File Encoding to Other: UTF-8 instead of the Default (Cp1252)

so I have been reading and trying all the options I have found online with no success. The Problem: Every time I start/restart my Eclipse (Neon 4.6.2) the encoding is set back to Other: UTF-8 (I want it to be the Default Cp1252). Screenshot. I have…
Argh
  • 63
  • 8
4
votes
1 answer

Numpy loadtxt encoding

I am trying to load data with numpy.loadtxt... The file im trying to read is using cp1252 coding. Is there a possibility to change the encoding to cp1252 with numpy? The following import numpy as np n = 10 myfile = '/path/to/myfile' mydata =…
suschi
  • 493
  • 2
  • 5
  • 8
4
votes
5 answers

Can I avoid using CP1252 on Windows?

I would like all my toolkit to use UTF-8 but find that some tools on Windows seem to use CP1252 (which appears to be Windows-specific). Does this create output which is incompatible and if so at which codepoints? If so, can I do anything about…
peter.murray.rust
  • 37,407
  • 44
  • 153
  • 217
4
votes
2 answers

How to read a .sav SPSS file in in R?

I've tried read.spps(), but I get an encoding error: library(foreign) read.spss('persona.sav') #>re-encoding from CP1252 Error in iconv(names(rval), cp, "") : unsupported conversion from 'CP1252' to '' In addition: Warning message: In…
Felipe Hoffa
  • 54,922
  • 16
  • 151
  • 325
1
2 3
8 9