gbl / ChatControl

0 stars 2 forks source link

Coloring the Tabs of the Chat #4

Closed Petschko closed 3 years ago

Petschko commented 3 years ago

Hey, I used the Config to add color to the Tabs in the Chat, but since you use the § sign for color I get a strange symbol in chat.

I noticed this happens in all mods which use the § color codes. Funny with they use the & color codes it works.

Well since your mod only allows the § Color codes it will always display like this:

Strange Symbol

The config line:

§2Global;/chat g;\[Chat\] Now you are in the channel Global.

fun fact after i started the client the config line changes to

ยง2Global;/chat g;\[Chat\] Now you are in the channel Global.

I think Minecraft can't really handle the § Symbol - Maybe its an encoding issue. Since I have a different charset, it may causes that trouble

I saved the file in UTF8 and it converted my § symbol to even an other symbol which looks more wrong

Unbenannt
Petschko commented 3 years ago

I can definitely say its an encoding issue, since the file is always non-utf8 when i start the client. Maybe use the & colors or save the config file as UTF-8, for support all over the world^^

Your file is currently saved always as "TIS-620"


I changed the encoding to "ANSI" and write-protected my file, so your mod cant change it on startup, now it works! Its a bad hotfix, I still recommend to fix that^^

gbl commented 3 years ago

Hm, it's been quite a while, but I think, that I don't ever write that file unless it doesn't exist. The code in src/main/java/de/guntram/mcmod/chatcontrol/ChatChannelRegistry.java seems to confirm that.

But I also don't specify an encoding when creating the FileReader, so Java takes the encoding that's used by the system definition. If your System is set up to use Ansi, then the file has to be in Ansi. May I ask which language you're using?

Petschko commented 3 years ago

Hm strange after I changed the encoding to ANSI, it works. But the File was created in TIS-620?

I'm from germany and I use Windows, so my System uses: https://en.wikipedia.org/wiki/Windows-1252

gbl commented 3 years ago

I'm German as well ... The File wasn't created in TIS-620; the file doesn't know which encoding it has. Windows tries to autodetect the file type from the content, and I guess TIS-620 is some encoding for some language that has the § symbol mapped to something that's more in use.

Petschko commented 3 years ago

Thats really strange... Well the issue is resolved for me, I just discovered most mods which use the § instead of the & color prefix, result in that kind of trouble