Russian letters are not displayed normally.
9 replies



24.05.21 03:31:28 pm
I need Russian letters to be displayed normally, I want to make local, global, faction(team), walkie-talkie chat.
Various chats. This is needed for my rp server. The only problem is that Russian letters are displayed incorrectly.
I tried to make this script, but it doesn't work:
The word "Привет" turns into: @825B.
This one doesn't work either:
Maybe need to use this method: https://mothereff.in/utf-8#Привет
\xD0\x9F\xD1\x80\xD0\xB8\xD0\xB2\xD0\xB5\xD1\x82 = Привет
I don't know how to do that. Need help. @
MikuAuahDark:
Various chats. This is needed for my rp server. The only problem is that Russian letters are displayed incorrectly.
I tried to make this script, but it doesn't work:
Code:
1
2
3
4
5
2
3
4
5
addhook("say","say_test")
function say_test(id, txt)
msg("UTF-8:"..txt.."")
return 1
end
function say_test(id, txt)
msg("UTF-8:"..txt.."")
return 1
end
The word "Привет" turns into: @825B.
This one doesn't work either:
Code:
1
2
3
4
5
2
3
4
5
addhook("say", "say_test")
function say_test(id, txt)
msg("UTF-8:"..txt:gsub(".", function(t) return string.format("x%02X", t:byte()) end))
return 1
end
function say_test(id, txt)
msg("UTF-8:"..txt:gsub(".", function(t) return string.format("x%02X", t:byte()) end))
return 1
end
Maybe need to use this method: https://mothereff.in/utf-8#Привет
\xD0\x9F\xD1\x80\xD0\xB8\xD0\xB2\xD0\xB5\xD1\x82 = Привет
I don't know how to do that. Need help. @

S.T.A.L.K.E.R. RP - https://discord.gg/wQUEKSB
As me and the OP discussed in Discord, this quite puzzle me up.
Printing each byte as hex result using code below
result in this being shown (top is "Привет", bottom is "Hello")

Further by writing reverse function for it
confirms that "Привет" gets transformed to "@825B" at
say.

I'd also like to know the solution to this problem.
Printing each byte as hex result using code below
Code:
1
2
3
4
5
2
3
4
5
addhook("say", "say_test")
function say_test(id, txt)
msg(txt:gsub(".", function(t) return string.format("x%02X", t:byte()) end))
return 1
end
function say_test(id, txt)
msg(txt:gsub(".", function(t) return string.format("x%02X", t:byte()) end))
return 1
end
result in this being shown (top is "Привет", bottom is "Hello")
Further by writing reverse function for it
Code:
1
2
3
2
3
function r(t)
return t:gsub("x(%x%x)", function(x) return string.char(tonumber(x, 16)) end)
end
return t:gsub("x(%x%x)", function(x) return string.char(tonumber(x, 16)) end)
end
confirms that "Привет" gets transformed to "@825B" at


I'd also like to know the solution to this problem.


Problem in the code itself, only SQ can manage to fix that, he already fixed that issue for main chat. Ask him for more if you want so.
CS2d for ANDROID Discord server is here: https://discord.gg/ww59nvf

S.T.A.L.K.E.R. RP - https://discord.gg/wQUEKSB

The problem is not that (if it works then my one-liner string.gsub equivalent should display correct text), but it seems



Oh that, I was working on this. I don't remember if I finished implementing solution.
Optimal way was to add "say_utf8" hook that would pass encoded text.
Original say hook provides byte characters only.
Optimal way was to add "say_utf8" hook that would pass encoded text.
Original say hook provides byte characters only.
@
SQ: as far as i remember that, problem was with counting bytes when parsing texts or something. You fixed that for chat itself when we talked in a discord

CS2d for ANDROID Discord server is here: https://discord.gg/ww59nvf
Will there be any update to correct the Russian letters in the custom chat? It is very important
.

S.T.A.L.K.E.R. RP - https://discord.gg/wQUEKSB



