godot: Unicode problem.
Godot version: 3.1 Stable (tested with latest master also)
OS/device including version: Windows 10
Issue description: I am receiving unicode messages through sockets that contain unicode characters, in my case Greek language characters.
-
StreamPeer
get_utf8_string
gives meUnicode error: invalid skip
. -
PoolByteArray
get_string_from_utf8
gives meUnicode error: invalid skip
. -
PoolByteArray
get_string_from_ascii
give me the full message but all unicode characters are converted to questionmarks.
I’m a bit frustrated with thisone, searched through issues but could not find any solution.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 21 (12 by maintainers)
The string is being sent from another application (of which i do not currently have the source code). I am doing:
If a split does not end with ENDTAG, i add it to the next message.
get_string
decodes the message to ascii since i get the same result asget_string_from_ascii
. That is, the whole string is fine (i’m pretty sure there is not partial data) except the unicde parts which are represented as question marks.In conclusion, i think this is a Unicode decoding problem and not network related.
Sorry, my fault, all messages end with an end tag ({end} in my case) not null terminated. Of course, everything you said applies in this case but, i’m just mentioning it because i have already build a mechanism to detect when the full message is received.