Encryption Issues with UTF-8 in Havana

Libraski

New member
Hey everyone,
I'm currently trying to set up a custom server with Havana, and I’m running into a weird issue with the encryption system.


Whenever I send messages that include special characters like ä, ö, ü, ß, the message gets cut off or the client freezes completely.

For example, if I write "täst", only "tä" shows up. If I send longer UTF-8 texts, the whole client crashes or disconnects silently.


I'm using the original Cryptography.java and everything is still in its default state (I didn't modify anything important). I tried to understand what's going wrong with the help of ChatGPT, but since I don't have much programming experience, it's hard for me to fully fix it myself.


So I'm hoping someone here might understand the internals of Havana's encryption system and could explain what’s causing this or how to properly handle UTF-8 in this setup.


Thanks a lot in advance 🙏
 
Please try with Havana 1.3
I am using Havana 1.3, but it doesn't work. I'm not sure if it's an issue with Havana itself, the database, or the DCR. ChatGPT told me it might be a problem with how the bytes are handled. Here's what it said:


If StringUtil.getCharset() does not return UTF-8, then special characters like Umlauts may be misinterpreted during conversion — leading to corrupted or unreadable text (e.g., � or strange symbols).

- The Umlaut ä in UTF-8 is encoded as 0xC3 0xA4
- In ISO-8859-1, it's 0xE4
- So if you're decoding bytes with the wrong charset, you end up with incorrect characters.

The problem is, I don't have enough programming knowledge to fully understand or fix this on my own 😅

If anyone knows how to solve this or where exactly I need to set UTF-8 in Havana or the client, I'd really appreciate the help!
 
Back
Top