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
4
votes
1 answer

How to convert an UTF String to ANSI and Create an ANSI text file in ExternalSD with JAVA-ANDROID

I wrote a android app in java to get user answers and save them in a file. The problem is that this file is saved in utf-8. The end user will open these files in the IBM SPSS, an application for windows that can read files only in ANSI…
NaN
  • 8,596
  • 20
  • 79
  • 153
3
votes
1 answer

python3 C extension module with cp1252 encoded string

I am writing a Python3 extension module for an existing C++ library which returns a string that appears to be in cp1252 encoding. The C++ function signature is int get_name(std::string& name); where name is the output variable that contains a…
3
votes
0 answers

Linux file size, java.nio and CP1252 multibyte character set

I have an Cp1252 file that I want to read as binary. ls -al from the terminal shows its size is 10 bytes. This java snippet however reports 18 bytes: Path path = Paths.get(lfile); SeekableByteChannel sbc = Files.newByteChannel(path,…
stuhpa
  • 306
  • 3
  • 13
3
votes
1 answer

Convert string from codepage 1252 to 1250

How can I convert one String with characters decoded in codepage 1252 into a String decoded in codepage 1250. For example String str1252 = "ê¹ś¿źæñ³ó"; String str1250 = convert(str1252); System.out.print(str1250); I want to find such convert()…
rafalry
  • 2,620
  • 6
  • 24
  • 39
3
votes
1 answer

How to force codeset cp1252 for output file in perl >=5.18 within Windows 10?

I need to make shure that the output file i create with my perl script has the codeset cp1252 and not UTF-8 because it will be used within a UNIX SQLplus framework which handles german "umlauts" not correctly when it insert that values into the…
drvolk
  • 35
  • 4
3
votes
1 answer

IntelliJ keeps switching to UTF8 (I want to set CP-1252)

I have some projects which are encoded with Windows-1252/CP-1252 and I can't change the encoding. The problem is, no matter what I do, intelliJ will keep trying to read these files as UTF-8 unless I manually put every single file in the encoding…
ax1223
  • 31
  • 3
3
votes
1 answer

Unmappable character for encoding Cp1252 when trying to compile Java program

I tried making a Hello World program in Java, but am getting a CP1252 error: import acm.program.*; public class test extends Program { public void run() { println(”Hello world!!!”); } } Here's the errors: C:\>javac -cp acm.jar…
Marios Ath
  • 618
  • 2
  • 9
  • 21
3
votes
2 answers

Cygwin terminal not displaying certain characters?

I am running a stock Cygwin install, with the wget package added. If I run a command wget -qO- tetristv.com/zapni.tv.php I get this; notice the incorrect display of characters session=OTA5Mjc0ODU5OA==&stream=play
#EXTINF:0,▒T 1
Zombo
  • 1
  • 62
  • 391
  • 407
2
votes
2 answers

How to detect charset in Java?

A half-year ago i faced with annoying problem. And still couldn't fix it. Problem is lying in log4j-logging, where default charset is utf 8. Sometimes i receiving messages with different encoding, CP1252. (There's no way to change this). Thus…
VirtualVoid
  • 1,005
  • 3
  • 17
  • 25
2
votes
1 answer

Python reading from file encoding problem

when I read like this, some files list_of_files = glob.glob('./*.txt') # create the list of files for file_name in list_of_files: FI = open(file_name, 'r', encoding='cp1252') Error: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d…
Adrian
  • 178
  • 1
  • 1
  • 13
2
votes
1 answer

Default java file.encoding is Cp1252 but created file is ISO-8859-1

I checked the default file encoding in jvm: System.out.println("***file.encoding::" + System.getProperty("file.encoding")); // ***file.encoding::Cp1252 But when I wrote new file using FileWriter: bf = new BufferedWriter(new…
2
votes
1 answer

Why can't I decode \xDF (ß) into UTF-8?

I have a bytestring b"\xDF". When I try to decode it to UTF-8, a UnicodeDecodeError is thrown. Decoding to CP1252 works fine. In both charsets, 0xDF is represented by the character "ß". So why the Error? >>> hex(ord("ß")) '0xdf' >>>…
Daniel
  • 3,092
  • 3
  • 32
  • 49
2
votes
1 answer

CP1252 to UTF-8 .DBF file PHP

I have a problem, I can not convert my string from CP1252 to UTF-8, my string comes from a .DBF (Windows) file that is read by my PHP functions My application is fully encoded in UTF8 My file .dbf is load with php-xbase $table = new Table($file,…
Node
  • 21
  • 3
2
votes
1 answer

Convert cp1252 to unicode in javascript

I need to convert cp125*2* text to unicode utf in javascript function. Function to convert CP125*1* to utf I already find. Please help me if you have this functionality, thanks!
Daniel
  • 21
  • 1
  • 3
2
votes
1 answer

php & mysql converting non- to unicode

I have characters like these on our web site: Fémnyomó That is a street address, entered in another language (though I do not know which). Here's the db setup: mysql 4.1.2log charset cp1252 West European (latin1) I'm using PHP but without…
Hans
  • 3,403
  • 3
  • 28
  • 33
1
2
3
8 9