celluloid / celluloid-io

UNMAINTAINED: See celluloid/celluloid#779 - Evented sockets for Celluloid actors
https://celluloid.io
MIT License
879 stars 93 forks source link

strange behavour with encoding bytes in examples #182

Closed woto closed 7 years ago

woto commented 7 years ago

hi, while playing with examples i found that some 'characters' working correctly but, some doesn't i made debugging log of

read = socket.readpartial(4096)
puts read.bytes

and found that for example russian symbol 'у' prints strange sequence of bytes:

app_1  | 209
app_1  | 255
app_1  | 244
app_1  | 255
app_1  | 253
app_1  | 6
app_1  | 13
app_1  | 10
app_1  | 255
app_1  | 251
app_1  | 6

problematic also character 'я'

app_1  | 209
app_1  | 255
app_1  | 245
app_1  | 255
app_1  | 253
app_1  | 6
app_1  | 13
app_1  | 10
app_1  | 255
app_1  | 251
app_1  | 6

and may be some others, but not much.

But opposite others for example 'а' prints correct char codes

app_1  | 208
app_1  | 176
app_1  | 13
app_1  | 10

this problem is reproductable

ioquatix commented 7 years ago

Is it a problem with celluloid-io or a general problem with encoding/io?

woto commented 7 years ago

@ioquatix wow! sorry for inconvenience. After trying code from stdlib i've got same problem. Moreover i've tried python ) and got same. Then i found on wiki that this is the limitation of telnet which i've used to testing. :) :(

nc utility works fine. thank you for reply!