wurstscript / WurstScript

Programming language and toolkit to create Warcraft III Maps
https://wurstlang.org
Apache License 2.0
225 stars 30 forks source link

Cyrillic (Unicode?) strings support #278

Closed AlexYukikaze closed 10 years ago

AlexYukikaze commented 10 years ago

Now print(some Cyrillic String) doesn't work properly, for example

package Test

init
    print("Огненный столб")      // russian name of Flame strike ability
    print(GetAbilityName('AHfs')) // localized string
    // output: 
    // ????????? ?????
    // Огненный столб
peq commented 10 years ago

Can you please check whether the file is encoded in UTF-8?

To check this in Eclipse, right click on the file and choose Properties. Then at the bottom the Text file encoding should be set to Default (inherited from container: UTF-8).

AlexYukikaze commented 10 years ago

When I try to change the encoding to UTF-8 print(cyrillic) prints a blank line

init
    print(GetAbilityName('AHfs'))
    print("Огненный столб")
    print("===========================") // separator

oc1qnbn 1

Crigges commented 10 years ago

Afaik changeing the file isn't enough, try out this: Windows > Preferences > General > Workspaces, set "Text file encoding" to "Other : UTF-8"

AlexYukikaze commented 10 years ago

image

package EncodingTest

init
    print("==================")
    print("= "+GetAbilityName('AHfs') + " =")
    print("==================")
    print("= Огненный столб =")
    print("==================")

result: image Hmm... :(

peq commented 10 years ago

Hm, can you please send me a map where cyrillic characters are working in Jass code? Then I can compare that with the output of Wurst.

I cannot even get the characters to work in the normal world editor.

Do you know if it worked with an older version of Wurst?

AlexYukikaze commented 10 years ago

Created without Wurst map here and with Wurst here

Do you know if it worked with an older version of Wurst?

sorry, no

peq commented 10 years ago

Hm, unfortunately I cannot test it. In my WC3 version it does not even show the characters in the pure Jass version you uploaded.

So I have just tried to adjust the encoding of the war3map.j now, maybe you can try to update (build should be ready in ca 10 minutes) and see if it works.

AlexYukikaze commented 10 years ago

Thanks, it's works