SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Discussion

Reply
 
Thread Tools Display Modes
Old 30/11/2017, 07:48 PM   #1
RageCraftLV
Big Clucker
 
Join Date: Jun 2016
Location: Latvia <3
Posts: 55
Reputation: 4
Question Sublime Text 3 encoding special characters

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.
__________________
RageCraftLV is offline   Reply With Quote
Old 30/11/2017, 10:16 PM   #2
Misiur
High-roller
 
Misiur's Avatar
 
Join Date: Jul 2009
Location: Poland
Posts: 2,535
Reputation: 552
Default Re: Sublime Text 3 encoding special characters

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!
Misiur is offline   Reply With Quote
Old 30/11/2017, 10:51 PM   #3
RageCraftLV
Big Clucker
 
Join Date: Jun 2016
Location: Latvia <3
Posts: 55
Reputation: 4
Default Re: Sublime Text 3 encoding special characters

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
__________________
RageCraftLV is offline   Reply With Quote
Old 30/11/2017, 11:29 PM   #4
Misiur
High-roller
 
Misiur's Avatar
 
Join Date: Jul 2009
Location: Poland
Posts: 2,535
Reputation: 552
Default Re: Sublime Text 3 encoding special characters

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
Misiur is offline   Reply With Quote
Old 30/11/2017, 11:44 PM   #5
RageCraftLV
Big Clucker
 
Join Date: Jun 2016
Location: Latvia <3
Posts: 55
Reputation: 4
Default Re: Sublime Text 3 encoding special characters

>>> view.encoding()
'Central European (Windows 1250)'
__________________
RageCraftLV is offline   Reply With Quote
Old 01/12/2017, 12:11 AM   #6
Misiur
High-roller
 
Misiur's Avatar
 
Join Date: Jul 2009
Location: Poland
Posts: 2,535
Reputation: 552
Default Re: Sublime Text 3 encoding special characters

Alright, so, have you tried saving it as such in sublime? Is it consistent with pawno now?
Misiur is offline   Reply With Quote
Old 01/12/2017, 02:29 PM   #7
RageCraftLV
Big Clucker
 
Join Date: Jun 2016
Location: Latvia <3
Posts: 55
Reputation: 4
Default Re: Sublime Text 3 encoding special characters

Saved with that encoding, still same messed up characters.
__________________
RageCraftLV is offline   Reply With Quote
Old 07/12/2017, 05:14 PM   #8
Konewka
Big Clucker
 
Konewka's Avatar
 
Join Date: Aug 2010
Posts: 71
Reputation: 2
Default Re: Sublime Text 3 encoding special characters

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.
Konewka is offline   Reply With Quote
Old 08/12/2017, 10:45 AM   #9
raydx
Big Clucker
 
raydx's Avatar
 
Join Date: Feb 2017
Posts: 149
Reputation: 50
Default Re: Sublime Text 3 encoding special characters

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".
raydx is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
help with Sublime Text 3 MarkNelson Scripting Help 12 01/12/2017 09:46 PM
Sublime Text 2 Help! +1 Rep ChristolisTV Scripting Help 5 27/09/2016 11:41 AM
Sublime encoding problem. h4Xz0R Scripting Help 13 28/06/2014 07:41 PM
Text Encoding and Linux Rob_Maate Everything and Nothing 3 01/08/2012 02:05 AM


All times are GMT. The time now is 03:57 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.