Juerd / eq3-max

Yet another thing that talks to the "eQ-3 MAX! Cube Lan Gateway"
Other
34 stars 15 forks source link

Room names in Russian: Codepage issues? #12

Open nokia-lmt opened 3 years ago

nokia-lmt commented 3 years ago

Good day,

All my rooms are named in Russian and all such labels are corrupted. (I suspect EQ3 Cube does not support UTF8?) See attached screenshot. Is there is a way to support non-latin characters? Thank you!

eq3 error

Juerd commented 2 years ago

Can you provide the output of a hex dump (which you can make with max | hd) please, at least the part where one room name should be? And can you provide the name of that room in proper cyrillic?

It looks like double encoded utf8 so it might very well be a bug or wrong assumption in this project, but I'd like to verify that first.

nokia-lmt commented 2 years ago

See attached please. I can't uderstand where to look for room names in such dump, sorry. MAX-HD

Juerd commented 2 years ago

Is the first room name Детскач? I can't read your language so I have no idea if that's correct. But if it is, a fix will be easy :)

nokia-lmt commented 2 years ago

Hi Juerd,

Yes, you're almost correct. The name of this room is Детская. If you can provide a hotfix, I'm ready to test it ASAP. Thanks in advance!

Juerd commented 2 years ago

Sorry, typo. Should be Детская (and it's only the first word).

Google says it's a word, so I'll assume this is right.

nokia-lmt commented 2 years ago

Yes, as I said this is a correct name of the room. I'm awaiting promised hotfix. Thanks in advance! Appreciate it.

Juerd commented 2 years ago

In lib/Max.pm add the following line:

 utf8::decode($name);

After the following two lines:

 $offset += 5 + length $name;
 and
 $offset += 16 + length $name;

This is an incomplete fix (don't set any room names using max name because that will likely break) but should suffice for testing if I'm on the right track.

nokia-lmt commented 2 years ago

Just applied changes and tested them - works perfectly! When to expect a complete version of the hotfix?

Max

Juerd commented 2 years ago

Glad that works! I don't know when I will get to fixing it.

nokia-lmt commented 2 years ago

Well noted, Juerd. In either case please keep me posted. Thank you!