Confusing encoding/compiling issue with special latvian characters - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Confusing encoding/compiling issue with special latvian characters (
/showthread.php?tid=529694)
Confusing encoding/compiling issue with special latvian characters -
ronyx69 - 03.08.2014
The special latvian language characters are these - ē ū ī ā љ ģ ķ ļ ћ č ņ. SA-MP supports them if windows system locale is set to latvian.
So I have a gamemode which calls my main include - eris_core.inc. That include calls other includes which are needed for my script; one of them is language.inc (I also tried lang.txt). The language file has to be saved with Baltic (Windows 1257) encoding so that the latvian characters work. Now with this I can put defines in the language file which define the text I need for my GM in latvian. I actually can use them and they work and compile fine in the gamemode.
This is where the problems begin - I want to use the same language defines in other includes, but when I do this I can't even compile, the compiler just uses a lot of cpu and hangs, doesn't do anything. How do I work around this? I want a central language file where I'll define all my text and use the defines in my GM and other includes. By the way I use Sublime Text to choose what encoding the files are saved in (everything else is saved in UTF-8 ).
If it's confusing you can look at the code here
http://theopenlabel.net76.net/Neue.rar (i just started it, it has some random test things in it). I noticed the problem when I started to make the commands include which freezed the compiler if it used any of the defined texts which had the special latvian symbols.
I feel really held up by this weirdness, I hope some one knows a workaround or a better way to do the whole seperate language file thing. Thanks.
EDIT: So, I realise this is a very specific and rare problem. I guess I'll just resort to putting all language defines in the corresponding includes which use them and save them with the Baltic (Windows 1257) encoding. I won't have a global language file but at least it works.