Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant Display German ÄÖÜß #551

Open
svenskoni opened this issue Mar 20, 2023 · 5 comments
Open

Cant Display German ÄÖÜß #551

svenskoni opened this issue Mar 20, 2023 · 5 comments

Comments

@svenskoni
Copy link

Describe the bug
Pagermon reader.js malformed the German Umlaute äöü ÄÖÜß

To Reproduce
Getting an Alarm with one of the Letter and you get some cryptic other Letter

Expected behavior
A clear and concise description of what you expected to happen.
It Should Display the Right Letter

Screenshots
Should be Kölner Straße
1

Should be Hürth Gleuel Burgstraße
2

Environment information:
OS: Ubuntu 22.04.2 LTS
Other details: Pagermon 0.3.12-beta

Additional context
i already have a Fix for this Problem. We need to change in Line 97 and 100 in reader.js
97
trimMessage = message.replace(/<[A-Za-z]{3}>/g, '').replace(/\[/g, "ä").replace(/\]/g, "ü").replace(/\\/g, "ö").replace(/\~/g, "Ä").replace(/\!/g, "Ü").replace(/\@/g, "Ö").replace(/\#/g, "ß").trim();
100
trimMessage = message.replace(/<[A-Za-z]{3}>/g, '').replace(/\[/g, "ä").replace(/\]/g, "ü").replace(/\\/g, "ö").replace(/\~/g, "Ä").replace(/\!/g, "Ü").replace(/\@/g, "Ö").replace(/\#/g, "ß")

@svenskoni svenskoni added the bug label Mar 20, 2023
@geelongmicrosoldering
Copy link
Collaborator

geelongmicrosoldering commented Mar 20, 2023

This issue is actually with the charset multimon-ng is using in your reader.sh

You could definitely use the replace function in reader.js, or pipe everything through sed, etc. But technically the appropriate fix is at the source.
https://manpages.debian.org/testing/multimon-ng/multimon-ng.1.en.html#C

You would want -C DE

Of course it really depends on your environment. You may need to update multimon-ng

A few people have had this issue with German/Swedish pocsag.

We wouldn't hard code your fix, because it might break some US encoding ect

Reader.js is providing the exact characters being fed to it. Its doing what its told

@DanrwAU
Copy link
Member

DanrwAU commented Jun 30, 2023

This is a wontfix for us. You need to select the correct Charset in Multimon as per @geelongmicrosoldering, different versions of multimon also handle this differently so makes it difficult to predict.

@DanrwAU DanrwAU closed this as completed Jun 30, 2023
@eopo
Copy link
Collaborator

eopo commented Aug 29, 2023

Well, not quite - We have hardcoded reader.js to replace the German charset to us charset. Since multimon now has the -C flag, we probably should remove that from reader.js and tell people to use the right Charset in Multimon.
@svenskoni Lösung: In Zeilen 97 und 100 der Datei reader.js befindet sich Code, der Umlaute entfernt und durch die Englische Codierung ersetzt. Wenn du den einfach löschst, sollte es gehen. /// Remove parts of lines 97 and 100 of reader.js.

@eopo eopo reopened this Aug 29, 2023
@geelongmicrosoldering
Copy link
Collaborator

Well, not quite - We have hardcoded reader.js to replace the German charset to us charset. Since multimon now has the -C flag, we probably should remove that from reader.js and tell people to use the right Charset in Multimon. @svenskoni Lösung: In Zeilen 97 und 100 der Datei reader.js befindet sich Code, der Umlaute entfernt und durch die Englische Codierung ersetzt. Wenn du den einfach löschst, sollte es gehen. /// Remove parts of lines 97 and 100 of reader.js.

I forgot that was there. It probably shouldn't be. Now I'm remembering that we are using an outdated multimon-ng in rpi builds for... Reasons? I feel like @DanrwAU or @marshyonline know the answer, less consistent decoding in newer builds or something.

So on that basis we probably need to either update multimon-ng or have some charset translations that can be changed in config or something.

For now i feel like those replace functions shouldn't be there, seeing as umlauts etc shouldn't come out of multimon anyway unless you are for whatever reason using a multimon-ng build that is configured to use that charset, but expecting english output. So i feel like those replace functions rectify a rare edge case of misconfiguration and it shouldn't be hardcoded to replace those characters at all.

@eopo
Copy link
Collaborator

eopo commented Aug 30, 2023

We used that, because multimon introduced a fully new format for flex messages that we couldn't parse. I think they integrated a new flag, that makes it use the old format, I'm not sure on that one though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants