# Uppercase Cyrillic character

**URL:** <https://forum.rasa.com/t/uppercase-cyrillic-character/41539>\
**Category:** Rasa Open Source\
**Created:** [March 21, 2021, 7:35pm UTC](https://forum.rasa.com/t/uppercase-cyrillic-character/41539 "2021-03-21T19:35:46Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![millerpro](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@millerpro](https://forum.rasa.com/u/millerpro)\
**Post date:** [March 21, 2021, 7:35pm UTC](https://forum.rasa.com/t/uppercase-cyrillic-character/41539/1 "2021-03-21T19:35:46Z")

</div>

Hi all, I’m still new to rasa. I noticed strange error if the file (nlu.yml, nlu\_\*.yml) contains an uppercase Cyrillic ‘И’ character. Executable commands rasa [shell | train | data validate] fail. From version 2.1 to version 2.4 there were no problems. Last rows in from debug log: File “c:\users\rakis\anaconda3\envs\rasa\_env\lib\encodings\cp1251.py”, line 23, in decode return codecs.charmap\_decode(input,self.errors,decoding\_table)[0] UnicodeDecodeError: ‘charmap’ codec can’t decode byte 0x98 in position 4089: character maps to On the example of the Russian alphabet Error:

- intent: inform examples: |
  - АБВГДЕЁЖЗ **И** ЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ

and works in lowercase ‘И’ character:

- intent: inform examples: |
  - АБВГДЕЁЖЗ **и** ЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ

rasa --version Rasa Version : 2.4.0 Rasa SDK Version : 2.4.0 Rasa X Version : None Python Version : 3.8.8 (also tried version 3.7.6) Operating System : Windows-10-10.0.19041-SP0 Python Path : c:\users\rakis\anaconda3\envs\rasa\_env\python.exe

The rest of the project files are original, which are created by the command rasa init

P.S. I’m really trying to improve my English 🙂

---

<div class="post-metadata">

**Author:** ![mloubser](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/mloubser/32/13021_2.png) [@mloubser](https://forum.rasa.com/u/mloubser)\
**Post date:** [March 23, 2021, 4:08pm UTC](https://forum.rasa.com/t/uppercase-cyrillic-character/41539/2 "2021-03-23T16:08:49Z")

</div>

You’ll want to save your training data files in UTF-8 encoding - the error indicates you’re using cp1251. If you’re using an IDE like VSCode or a text editor like Notepad++ you can make that the default (which I would recommend)

---

<div class="post-metadata">

**Author:** ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)\
**Post date:** [March 23, 2021, 4:41pm UTC](https://forum.rasa.com/t/uppercase-cyrillic-character/41539/3 "2021-03-23T16:41:05Z")

</div>

I have the same problem @mloubser:

> [@'charmap' codec can't decode byte 0x81 after 2.4.0 update](http://forum.rasa.com/t/charmap-codec-cant-decode-byte-0x81-after-2-4-0-update/41569):
>
> After updating to 2.4.0, without changing anything in the files, I get this error when training/validating: Skipping registering GPU devices... Traceback (most recent call last): File "E:\Program Files\Python\Python38\lib\runpy.py", line 192, in \_run\_module\_as\_main return \_run\_code(code, main\_globals, None, File "E:\Program Files\Python\Python38\lib\runpy.py", line 85, in \_run\_code exec(code, run\_globals) File "E:\...\_venv\lib\site-packages\rasa\_\_main\_\_.py", line 134, in \<module\>…

In my case, the error says CP1252, but I checked all of my files, they’re all encoded UTF-8 according to VSCode.

---

<div class="post-metadata">

**Author:** ![koaning](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/koaning/32/6626_2.png) [@koaning](https://forum.rasa.com/u/koaning)\
**Post date:** [March 24, 2021, 9:42am UTC](https://forum.rasa.com/t/uppercase-cyrillic-character/41539/4 "2021-03-24T09:42:03Z")

</div>

Hi all. I’ve just tried to reproduce this issue and I can confirm that on my machine it seems to work fine. I’ve started a `rasa init` project with this example in the `nlu.yml`:

```auto
АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ

```

The `rasa train` command works fine on my machine and I have tried on Rasa `2.3.4` and `2.4.1`. This makes me think that what you’re experiencing might be related to Windows.

Are you 100% sure that it’s not a UTF-8 related issue?

---

<div class="post-metadata">

**Author:** ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)\
**Post date:** [March 24, 2021, 9:44am UTC](https://forum.rasa.com/t/uppercase-cyrillic-character/41539/5 "2021-03-24T09:44:15Z")

</div>

Thanks for the response.

This is weird, VSCode says all my files are UTF-8. I even saved them again as UTF-8 just to be sure. Is there a better way of checking than looking at VSCode? ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/9/9859dd65de1deea155863468c00e03c2fe5b20ce.png)

---

<div class="post-metadata">

**Author:** ![koaning](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/koaning/32/6626_2.png) [@koaning](https://forum.rasa.com/u/koaning)\
**Post date:** [March 24, 2021, 9:46am UTC](https://forum.rasa.com/t/uppercase-cyrillic-character/41539/6 "2021-03-24T09:46:15Z")

</div>

There’s a settings suggestion [here](https://stackoverflow.com/questions/30082741/change-the-encoding-of-a-file-in-visual-studio-code) but I believe the utf-8 mention at the bottom should confirm it.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/1/19eb5d96b2e2bc202a2622eb2274883672162cba.png)

Maybe restart VSCode? I know it sounds silly, but my experience this helps with VSCode settings.

---

<div class="post-metadata">

**Author:** ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)\
**Post date:** [March 24, 2021, 9:47am UTC](https://forum.rasa.com/t/uppercase-cyrillic-character/41539/7 "2021-03-24T09:47:34Z")

</div>

Yeah, both the default encoding and the footer show UTF-8.

I’ll try `rasa init` and put a few examples.

---

<div class="post-metadata">

**Author:** ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)\
**Post date:** [March 24, 2021, 10:01am UTC](https://forum.rasa.com/t/uppercase-cyrillic-character/41539/8 "2021-03-24T10:01:44Z")

</div>

@koaning I did `rasa init`, and I changed the three attached files (just added an intent that leads to utter\_greet).

[nlu.yml](https://forum.rasa.com/uploads/short-url/4Ojov7MwlMiKkzzdtBUbZ2JDjVn.yml) (3.7 KB) [rules.yml](https://forum.rasa.com/uploads/short-url/th9t0WMYigQ4obZX1NC9DWn1sbZ.yml) (331 Bytes) [domain.yml](https://forum.rasa.com/uploads/short-url/okGz7O33sfKtmm5SVe31sFRVHrL.yml) (586 Bytes)

Notepad++ and VSCode both show UTF-8.

After `rasa train`, I still get the error.

---

<div class="post-metadata">

**Author:** ![koaning](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/koaning/32/6626_2.png) [@koaning](https://forum.rasa.com/u/koaning)\
**Post date:** [March 24, 2021, 11:02am UTC](https://forum.rasa.com/t/uppercase-cyrillic-character/41539/9 "2021-03-24T11:02:16Z")

</div>

Can you confirm if you can open files via;

```auto
file = open(filename, encoding="utf8")

```

---

<div class="post-metadata">

**Author:** ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)\
**Post date:** [March 24, 2021, 11:04am UTC](https://forum.rasa.com/t/uppercase-cyrillic-character/41539/10 "2021-03-24T11:04:53Z")

</div>

I can, and `file.readlines()` gives the correct output

---

<div class="post-metadata">

**Author:** ![koaning](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/koaning/32/6626_2.png) [@koaning](https://forum.rasa.com/u/koaning)\
**Post date:** [March 24, 2021, 11:12am UTC](https://forum.rasa.com/t/uppercase-cyrillic-character/41539/11 "2021-03-24T11:12:48Z")

</div>

@millerpro @ChrisRahme I might want to check where in our code this error originates. Could you share the full traceback?

---

<div class="post-metadata">

**Author:** ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)\
**Post date:** [March 24, 2021, 11:30am UTC](https://forum.rasa.com/t/uppercase-cyrillic-character/41539/12 "2021-03-24T11:30:20Z")

</div>

Sure:

```auto
Skipping registering GPU devices...
Traceback (most recent call last):
  File "E:\Program Files\Python\Python38\lib\runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "E:\Program Files\Python\Python38\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "E:\...\_venv\lib\site-packages\rasa\ __main__.py", line 134, in <module>
    main()
  File "E:\...\_venv\lib\site-packages\rasa\ __main__.py", line 116, in main
    cmdline_arguments.func(cmdline_arguments)
  File "E:\...\_venv\lib\site-packages\rasa\cli\train.py", line 58, in <lambda>
    train_parser.set_defaults(func=lambda args: train(args, can_exit=True))
  File "E:\...\_venv\lib\site-packages\rasa\cli\train.py", line 90, in train
    training_result = rasa.train(
  File "E:\...\_venv\lib\site-packages\rasa\train.py", line 94, in train
    return rasa.utils.common.run_in_loop(
  File "E:\...\_venv\lib\site-packages\rasa\utils\common.py", line 307, in run_in_loop
    result = loop.run_until_complete(f)
  File "E:\Program Files\Python\Python38\lib\asyncio\base_events.py", line 608, in run_until_complete
    return future.result()
  File "E:\...\_venv\lib\site-packages\rasa\train.py", line 151, in train_async
    file_importer = TrainingDataImporter.load_from_config(
  File "E:\...\_venv\lib\site-packages\rasa\shared\importers\importer.py", line 85, in load_from_config
    return TrainingDataImporter.load_from_dict(
  File "E:\...\_venv\lib\site-packages\rasa\shared\importers\importer.py", line 150, in load_from_dict
    RasaFileImporter(
  File "E:\...\_venv\lib\site-packages\rasa\shared\importers\rasa.py", line 33, in __init__
    self._story_files = rasa.shared.data.get_data_files(
  File "E:\...\_venv\lib\site-packages\rasa\shared\data.py", line 152, in get_data_files
    new_data_files = _find_data_files_in_directory(path, filter_predicate)
  File "E:\...\_venv\lib\site-packages\rasa\shared\data.py", line 172, in _find_data_files_in_directory
    if filter_property(full_path):
  File "E:\...\_venv\lib\site-packages\rasa\shared\data.py", line 220, in is_story_file
    return YAMLStoryReader.is_stories_file(
  File "E:\...\_venv\lib\site-packages\rasa\shared\core\training_data\story_reader\yaml_story_reader.py", line 163, in is_stories_file
    return rasa.shared.data.is_likely_yaml_file(file_path) and cls.is_key_in_yaml(
  File "E:\...\_venv\lib\site-packages\rasa\shared\core\training_data\story_reader\yaml_story_reader.py", line 183, in is_key_in_yaml
    return any(
  File "E:\...\_venv\lib\site-packages\rasa\shared\core\training_data\story_reader\yaml_story_reader.py", line 183, in <genexpr>
    return any(
  File "E:\Program Files\Python\Python38\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 662: character maps to <undefined>

```
