Skip to content

Cyrillic is not supported #9

Open

Description

@DedMaxim

As said in title, Cyrillic is not supported. Trying to compile a script with Cyrillic letters throws following error:

Compiler encountered unexpected error during compilation:
Traceback (most recent call last):
  File "E:\Program Files\CBScript\cbscript.py", line 70, in try_to_compile
    success = self.compile_all()
  File "E:\Program Files\CBScript\cbscript.py", line 134, in compile_all
    world.write_functions(self.global_context.functions)
  File "E:\Program Files\CBScript\mcworld.py", line 33, in write_functions
    text = func.get_utf8_text()
  File "E:\Program Files\CBScript\mcfunction.py", line 434, in get_utf8_text
    return "\n".join([(cmd if cmd[0] != '/' else cmd[1:]) for cmd in self.commands]).encode('utf-8')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 104: ordinal not in range(128)

Script is simple:

dir "C:\Users\Max\Desktop\Alcore Impact Server\world"
desc "A datapack that tells dialog lines"

import common

reset
end

function test1()
	/execute positioned -222.66 98.00 -157.52 run execute at @a[distance=..5] run tellraw @a {"text":"[Mage] ыдвлаожфдвлоа!"}
end

As a workaround, Cyrillic letters can be converted to Java entities through web translators like this one http://www.itpro.cz/juniconv/
But it's not as convenient as being able to actually see letters in the script

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions