aatxe / irc

the irc crate – usable, async IRC for Rust
Mozilla Public License 2.0
530 stars 97 forks source link

Strange encoding behaviour #95

Closed ParadoxSpiral closed 7 years ago

ParadoxSpiral commented 7 years ago

When receiving the PRIVMSG äöü, the message content is ���, while e.g. 高垣彩陽 is correctly transmitted. This happens on rizon, but not on freenode.

I don't have a small reproducer rn, but I encountered this while working on an irc bot.

aatxe commented 7 years ago

Are you sure that you've configured the bot on Rizon to use the correct encoding for the server?

ParadoxSpiral commented 7 years ago

I think so, you mean this?

aatxe commented 7 years ago

Yeah, are you sure that Rizon uses UTF-8? It sounds like it doesn't.

ParadoxSpiral commented 7 years ago

Well, if it didn't wouldn't the japanese characters also be wrong? Sending äöü with e.g. Hexchat to other people works.

aatxe commented 7 years ago

I couldn't tell you. It's possible that the Japanese characters are the same in the encoding they use as UTF-8, but the one for umlauts are not.

ParadoxSpiral commented 7 years ago

Asked in #help, and they say that Rizon uses UTF-8.

aatxe commented 7 years ago

Well, I just attempted to send this message on Rizon using the bot in example/simple.rs and could not reproduce the bug.

ParadoxSpiral commented 7 years ago

Weird. Only changing the channel & server reproduces for me: :ParadoxSpiral!~ParadoxSp@F6B8A582:9E72264:5D6CC095:IP PRIVMSG #parabot_testing :���

FreeFull commented 7 years ago

I think some clients are broken and don't always send UTF-8 for all messages. I'm not sure why it wouldn't happen on freenode though.

aatxe commented 7 years ago

Yeah, that seems to be exactly what's happening. @ParadoxSpiral is using Xchat, and Xchat seems to be the common factor in messages that appear incorrectly.

ParadoxSpiral commented 7 years ago

Seems like it. We did some testing, and this only happens when my client (xchat, not hexchat) sends the message.