Questions tagged [cp1251]

Windows-1251 (a.k.a. code page CP1251) is a popular 8-bit character encoding, designed to cover languages that use the Cyrillic script such as Russian, Bulgarian, Serbian Cyrillic and other languages. It is the most widely used for encoding the Bulgarian, Serbian and Macedonian languages. In modern applications, Unicode is a preferred character set.

Windows-1251 or code page CP1251 is a popular 8-bit character encoding, designed to cover languages that use the Cyrillic script such as Russian, Bulgarian, Serbian Cyrillic and other languages. It is the most widely used for encoding the Bulgarian, Serbian and Macedonian languages. In modern applications, Unicode is a preferred character set.

Source and more information: Windows-1251 on the English Wikipedia

76 questions
27
votes
6 answers

How to convert a string from CP-1251 to UTF-8?

I'm using mutagen to convert ID3 tags data from CP-1251/CP-1252 to UTF-8. In Linux there is no problem. But on Windows, calling SetValue() on a wx.TextCtrl produces the error: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position …
jsnjack
  • 2,630
  • 2
  • 21
  • 21
7
votes
2 answers

Change file encoding without information losses in intellij idea

Is it possible to change file's encoding from UTF-8 to windows1251 without cyrillic information lost. Because when I explicitely change the encoding, all cyrillic symbols become unreadable?
Sergey
  • 11,548
  • 24
  • 76
  • 113
7
votes
1 answer

UnicodeDecodeError in PyCharm debugger

Its a reference to UnicodeDecodeError while using cyryllic . I have same problem with Python 3.3 and Pycharm 2.7.2 Tryed to hardcode encoding in code, manually specifying encoding in Pycharm options, but no effect. It still tries to open utf-8 file…
Alex T
  • 489
  • 1
  • 6
  • 9
6
votes
2 answers

Decoding a url-encoded windows-1251 (cp1251) string with JavaScript

I have faced a problem, unfortunately, I have not found a correct solution: I need to decode url-slice that is encoded with windows-1251 (cp1251). I know there are theese methods - decodeURI() and decodeURIComponent(), but they work for UTF-8 only…
Romanzhivo
  • 161
  • 1
  • 3
  • 11
5
votes
3 answers

Java: convert UTF8 String to byte array in another encoding

I have UTF8 encoded String, but I need to post parameters to Runtime process in cp1251. How can I decode String or byte array? I need smth like:.bytesInCp1251 = encodeTo(stringInUtf8, "cp1251"); Thanks to all! This is my own…
Pavel Vyazankin
  • 1,470
  • 6
  • 18
  • 27
4
votes
4 answers

Recovering filenames with bad encoding

I've been struggling with this problem for a while but working with encoding is so painful that I have to come to your smarter minds for some help. In a trip I made to Ukraine a friend copied to my pen drive me some Ukrainian named files. However,…
Felipe Ferri
  • 3,488
  • 2
  • 33
  • 48
4
votes
1 answer

Browser displaying page in UTF-8 instead of windows-1251

I have a website, it contains html only, and there is a lot of cyrillic symbols. Browser is setting the UTF-8 encoding, instead of windows-1251, like it should be. So, english letters displays fine, but every cyrillic symbols is like ���� Here is my…
Alexander
  • 3,129
  • 2
  • 19
  • 33
4
votes
1 answer

Converting file from cp1251 to utf8

I saw similar questions but answers to them didn't help. This code: with codecs.open( sourceFileName, "r", sourceEncoding, ) as sourceFile: contents = sourceFile.read() with codecs.open( sourceFileName, "w", "utf-8") as targetFile: if…
Amomum
  • 6,217
  • 8
  • 34
  • 62
4
votes
3 answers

php: converting from cp1251 to utf8

I have a problem converting a string from cp1251 to utf8... I need to get some names from database and those names are in cp1251(i'm not the one who made that database, so I can't edit it, but I know for sure that these names are cp1251)... The name…
Pigalev Pavel
  • 1,155
  • 1
  • 15
  • 29
4
votes
2 answers

The proper way of encoding detection in perl

I've got these two strings: %EC%E0%EC%E0+%EC%FB%EB%E0+%F0%E0%EC%F3 %D0%BC%D0%B0%D0%BC%D0%B0%20%D0%BC%D1%8B%D0%BB%D0%B0%20%D1%80%D0%B0%D0%BC%D1%83 This is a url-encoded phrase in Russian in cp-1251 and utf-8 respectively. I want to see them in…
Igor Shalyminov
  • 694
  • 2
  • 8
  • 22
3
votes
3 answers

Perl: converting from cp1251 to utf8

I try to convert string to utf8. #!/usr/bin/perl -w use Encode qw(encode decode is_utf8); $str = "\320\300\304\310\323\321 \316\320\300\312\313"; Encode::from_to($str, 'windows-1251', 'utf-8'); print "converted:\n$str\n"; And in this case I get…
Voland Kem
  • 33
  • 1
  • 3
3
votes
1 answer

Configuring Tomcat 6 to support Russian cp1251 encoding

I am migrating a struts application from Websphere to Tomcat 6 and my application has support for Russian language. In Websphere we use to pass the JVM param -Dclinet.encoding.override=cp1251 but when I tried this with tomcat by passing the JVM…
prabhu
  • 919
  • 2
  • 12
  • 28
3
votes
1 answer

Decoding cp1251 to UTF-8 in javascript

How to decode cp-1251 to UTF-8 in javascript? The cp-1251 is from a datafeed, which required to decode from js client side. There is no way to change server side output, since it is related to a 3rd party, and due to some reason, I would not use any…
user192344
  • 1,274
  • 6
  • 22
  • 36
2
votes
1 answer

Android set character encoding

How can I set the encoding of EditText value? I tried this but it does not seem to work. String test = new String(myField.getText().toString().getBytes(), "Cp1251"); The receiver still has invalid value.
Vame
  • 2,033
  • 2
  • 18
  • 29
2
votes
2 answers

Visual Studio Code can't encode cyrillic characters in output

Output in Visual Studio Code can't decode Cyrillic characters: The same code works fine in PyCharm: How do I quickly fix this issue? There must be some simple way. Auto Guess Encoding in Settings doesn't work since it's for files, not the…
Anatoly
  • 69
  • 2
  • 6
1
2 3 4 5 6