# Forum breaks when using Windows-1251 Cyrillic/Russian encoding

**URL:** https://meta.discourse.org/t/forum-breaks-when-using-windows-1251-cyrillic-russian-encoding/135970
**Category:** Support
**Created:** [December 14, 2019, 10:34pm UTC](https://meta.discourse.org/t/forum-breaks-when-using-windows-1251-cyrillic-russian-encoding/135970 "2019-12-14T22:34:48Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![j127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j127/32/79093_2.png) [@j127](https://meta.discourse.org/u/j127)
#### Post date: [December 14, 2019, 10:34pm UTC](https://meta.discourse.org/t/forum-breaks-when-using-windows-1251-cyrillic-russian-encoding/135970/1 "2019-12-14T22:34:48Z")

</div>

It looks like Discourse forums don’t load if the character encoding is set to [Windows-1251](https://en.wikipedia.org/wiki/Windows-1251) for Russian.

To reproduce, set the character encoding to “Cyrillic (Windows-1251)” and visit the homepage of a forum. It will just be a blank page. There are error messages in the console that look something like this:

```plaintext
Uncaught SyntaxError: Invalid regular expression: 
/^[^A-Za-zГЂ-Г–Г-Г¶Гё-КёМЂ-Цђа Ђ-бїїв°Ђ-п¬њп·ѕ-п№Їп»Ѕ-пїї]*[Ц‘-Яїп¬ќ-п·Ѕп№°-п»ј]/: 
Range out of order in character class
    at new RegExp (<anonymous>)

```

(I’ve only tried it with two Discourse forums – Meta Discourse and my main forum.)

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [December 14, 2019, 10:46pm UTC](https://meta.discourse.org/t/forum-breaks-when-using-windows-1251-cyrillic-russian-encoding/135970/2 "2019-12-14T22:46:51Z")

</div>

Why would you do that? Discourse uses UTF-8 and that works for Russian too.

---

<div class="post-metadata">

### Author: ![j127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j127/32/79093_2.png) [@j127](https://meta.discourse.org/u/j127)
#### Post date: [December 14, 2019, 11:05pm UTC](https://meta.discourse.org/t/forum-breaks-when-using-windows-1251-cyrillic-russian-encoding/135970/3 "2019-12-14T23:05:03Z")

</div>

I wouldn’t do it myself. 🙂

A user in Russia was getting a blank page. It took several hours to track down the cause and I couldn’t reproduce it until I set my browser’s encoding to Windows-1251.

I’m wondering if other Russian language users are experiencing blank pages. It’s apparently set on his computer at the OS level (Windows), and there isn’t an easy way to change a browser’s character encoding any more without some manual configuration. The browsers’ encoding auto-detection features aren’t working well. We tried Chrome and Firefox.

---

<div class="post-metadata">

### Author: ![Stranik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stranik/32/85638_2.png) [@Stranik](https://meta.discourse.org/u/Stranik)
#### Post date: [December 15, 2019, 6:25am UTC](https://meta.discourse.org/t/forum-breaks-when-using-windows-1251-cyrillic-russian-encoding/135970/4 "2019-12-15T06:25:09Z")

</div>

We have several forums working in Russia. There is no problem if, as written above, UTF-8 is used. We did not experiment or set the encoding Windows-1251. What for? UTF-8 works for everything.

There was no blank page on any of the forums. The browser does not switch to windows-1251.

I tried in 3 browsers to force to expose Windows-1251. If the forum is in utf-8 we only gets the wrong encoding. A blank page is not observed.

 ![1](https://global.discourse-cdn.com/meta/original/3X/9/5/95fd28fa655513fa04b7eb3e40962b40d3160d30.jpeg)

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [December 15, 2019, 6:33am UTC](https://meta.discourse.org/t/forum-breaks-when-using-windows-1251-cyrillic-russian-encoding/135970/5 "2019-12-15T06:33:55Z")

</div>

cp1251 isn’t dead yet, so I’m not stunned to hear that some users still have a browser which defaults to it.

As of this month(16/12/19) [a little over 11% of .ru sites use windows-1251](https://w3techs.com/technologies/segmentation/tld-ru-/character_encoding).

---

<div class="post-metadata">

### Author: ![j127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j127/32/79093_2.png) [@j127](https://meta.discourse.org/u/j127)
#### Post date: [December 15, 2019, 8:06am UTC](https://meta.discourse.org/t/forum-breaks-when-using-windows-1251-cyrillic-russian-encoding/135970/6 "2019-12-15T08:06:59Z")

</div>

I’m not sure why you aren’t seeing it there. I used [this browser plugin](https://chrome.google.com/webstore/detail/set-character-encoding/bpojelgakakmcfmjfilgdlmhefphglae) in Chromium to test it. (Firefox seems to disable the character encoding menu on some sites.)

I just tried with a third Discourse forum, and that one doesn’t load either.

I don’t know why that user has the OS set to Windows-1251. I’m going to try to find out how often it’s happening.

---

<div class="post-metadata">

### Author: ![Stranik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stranik/32/85638_2.png) [@Stranik](https://meta.discourse.org/u/Stranik)
#### Post date: [December 15, 2019, 8:22am UTC](https://meta.discourse.org/t/forum-breaks-when-using-windows-1251-cyrillic-russian-encoding/135970/7 "2019-12-15T08:22:02Z")

</div>

Interesting, please look, with this plugin there is a white page on the forum: [https://toxu.ru](https://toxu.ru) I watched the encoding windows-1251 on this site.

---

<div class="post-metadata">

### Author: ![j127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j127/32/79093_2.png) [@j127](https://meta.discourse.org/u/j127)
#### Post date: [December 15, 2019, 8:15pm UTC](https://meta.discourse.org/t/forum-breaks-when-using-windows-1251-cyrillic-russian-encoding/135970/8 "2019-12-15T20:15:56Z")

</div>

When I visit your site and set it to Windows-1251, I get a blank page and these errors (same as the other sites).

 ![error](https://global.discourse-cdn.com/meta/original/3X/2/b/2baee200b81236fcfad35c8119800a6bd30c8bc0.png)

I’ve just heard an update from the user though — they are using Windows XP with Chrome 49, so that is probably the source of the problem.

I did a quick search through the analytics and there have been 281 visits by 85 users on Windows XP in the past 28 days. I don’t feel like our site needs to support Windows XP, but I’d like to figure out a way to at least serve those people a “please upgrade your browser to use this site” message.

I’m going to recommend that this user upgrades the OS, at least to [Linux](https://www.addictivetips.com/ubuntu-linux-tips/make-your-linux-desktop-look-like-windows-xp/).

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [December 15, 2019, 8:25pm UTC](https://meta.discourse.org/t/forum-breaks-when-using-windows-1251-cyrillic-russian-encoding/135970/9 "2019-12-15T20:25:36Z")

</div>

Chrome dropped XP in April 2016. Firefox dropped in June 2018 so it’s a better alternative than Chrome. But in the end the user should upgrade ASAP.

---

<div class="post-metadata">

### Author: ![j127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j127/32/79093_2.png) [@j127](https://meta.discourse.org/u/j127)
#### Post date: [December 15, 2019, 8:38pm UTC](https://meta.discourse.org/t/forum-breaks-when-using-windows-1251-cyrillic-russian-encoding/135970/10 "2019-12-15T20:38:09Z")

</div>

I’m going to warn them about the security risks and offer to assist with Linux if they want to do that.

During the debugging I made a long list of everything to check for when those requests come in. I need to add “Windows NT 5.1” and browser versions to the list for next time.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [October 3, 2023, 9:27am UTC](https://meta.discourse.org/t/forum-breaks-when-using-windows-1251-cyrillic-russian-encoding/135970/12 "2023-10-03T09:27:32Z")

</div>



---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [October 3, 2023, 9:52am UTC](https://meta.discourse.org/t/forum-breaks-when-using-windows-1251-cyrillic-russian-encoding/135970/13 "2023-10-03T09:52:25Z")

</div>


