- 70
- 8
- Версия MoonLoader
- .027.0-preview
Таким кодом вывожу текст, русские символы почему-то не выводятся. Кодировка стоит Windows 1251
```
function onReceivePacket(id, bs)
if id == 247 then
local text, packets = bitStreamStructure(bs)
print(u8(text))
end
end
```
```
function bitStreamStructure(bs)
local text, array = '', {}
for i = 1, bs:getNumberOfBytesUsed() do
local byte = bs:readInt8()
if byte >= 32 and byte <= 255 and byte ~= 37 then text = text .. string.char(byte) end
end
bs:resetReadPointer()
return text, array
end
```
```
function onReceivePacket(id, bs)
if id == 247 then
local text, packets = bitStreamStructure(bs)
print(u8(text))
end
end
```
```
function bitStreamStructure(bs)
local text, array = '', {}
for i = 1, bs:getNumberOfBytesUsed() do
local byte = bs:readInt8()
if byte >= 32 and byte <= 255 and byte ~= 37 then text = text .. string.char(byte) end
end
bs:resetReadPointer()
return text, array
end
```