UTF8 decode/encode plugin
#1

I don't know if there is any more effective method of correctly displaying utf8 characters, but for now I'm using https://sampforum.blast.hk/showthread.php?tid=223944 plugin.

pawn Код:
main() {
    new str[32];
    UTF8_Encode("żołw", str, sizeof str);
    UTF8_Decode(str, str, sizeof str);
    printf(str);
    printf("żуłw");
}
Prints "żуłw" and some bushes as expected. Now when I want to shorten the code a little ("Е»ГіЕ‚w" is utf8 encoded "żуłw"):
pawn Код:
main() {
    new str[32];
    UTF8_Decode("Е»ГіЕ‚w", str, sizeof(str));
    printf(str);
}
Bam! Server crash.

The pwn document is encoded in _ascii_ - only this way I get the correct characters to show up. Is there some other way of handling nonascii charsets?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)