Sublime Text 3 encoding special characters
#1

I'm using Sublime Text 3 to code, as I find it very easy to use, nice syntax and many useful features. The only problem is that I can't code in my native language. It's hard for me to explain it, but I'll try.

In order to show latvian characters in SA:MP in-game, I have to set system locale to latvian. When I do that and write something in latvian in Pawno editor, compile it and text shows up as it should. Here's where the problem starts. When I even just re-save the script in Sublime Text 3 or N++, it won't show special characters in Pawno editor anymore and won't work in-game. Even if I save as Baltic encoding, UTF-8 and so on. The special characters I'm talking about are "ā", "ē", "č", "ņ", "ķ" and so on. And don't say "****** it", because I already did, and found only 1 topic about this with no solution. In Latvia we don't have many people that script pawn. Can anyone give me some advice here?

Latvian special characters wrote in Pawno editor - http://prntscr.com/hhfuu9

Same file open with Sublime Text 3 - https://prnt.sc/hhfvlw

If I write and save the script in Pawno editor, it will show exactly like that in-game, just like I need.

But if I save in Pawno, re-save with something else, it won't show up correctly even in Pawno anymore.
Reply
#2

Hello Latvian friend. I tested with polish characters (not all are supported it seems, for example "ń" is turned into "с" in pawno). Anyway, it seems PAWNO default encoding is Windows 1252

Set that in your sublime and see that characters are preserved when you reopen the file in PAWNO.

Cheers!
Reply
#3

Still not working. It shows the special characters kinda weird, but I could get used to it. The problem is it shows character 'ā' like 'в', bet when I type in a special character, it shows up as 'ā', not the weird one. Hope you understood me. :P
Reply
#4

Hm, this is weird: when I paste that character in pawno it gets automatically transformed into normal "a". Let's check something: do the same things as me. Open a file in pawno, save it, open it in sublime. Press ctrl+` (leftmost key on numeric row (I think, don't know if you have same keyboard layout)). It should show sublime console. Execute "view.encoding()" in there. I suspect pawno tries to be smart and uses your default system encoding or something. Report back with results
Reply
#5

>>> view.encoding()
'Central European (Windows 1250)'
Reply
#6

Alright, so, have you tried saving it as such in sublime? Is it consistent with pawno now?
Reply
#7

Saved with that encoding, still same messed up characters.
Reply
#8

Central European (Windows 1250) does not support Latvian language. In fact, it is assigned, among other Baltic languages, to ISO-8859-4 of ASCII character encoding set, or, as assigned by Microsoft, to Windows-1257. Here is what you can do. Try copying the script from pawno compiler with ctrl+a, then paste that code to a blank Sublime file and look for encoding mentioned before. If that won't work, create a blank file in Sublime with that encoding first before pasting the content of your script.

If you still can't resolve that issue, play with different encoding options and transforming from one to another. Remember though to avoid applying UTF-8 encoding as it is not supported by SA-MP whatsoever. Usually, it does the trick in other applications, but this is not the case here.
Reply
#9

Windows 1250 is working for me (polish language). Every character is fine.
Just don't use pawno and sublime, choose one.

Remember to use "Reopen with encoding".
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)