UTF-8 logs #458

Closed
opened 2026-10-05 04:22:40 +02:00 by adam · 7 comments
Owner

When outputting my logs with cat some special characters are replaced with '?', for example characters with accents.

When I manually prepend the UTF-8 BOM to the log file, cat displays all characters properly.

When outputting my logs with cat some special characters are replaced with '?', for example characters with accents. When I manually prepend the UTF-8 BOM to the log file, cat displays all characters properly. <!-- github-sync-id:55468188 -->
adam closed this issue 2026-10-05 04:22:40 +02:00
Author
Owner

Fix your terminal.

Fix your terminal. <!-- github-comment-id:71443077 -->
Author
Owner

I have the following environment variables set to

LANG=fr_FR.UTF-8
LC_CTYPE=fr_FR.UTF-8

The file utility reports a ISO-8859 text file type.

Not saying that my terminal doesn't need fixing and that the issue is with ZNC, trying to get a correct understanding of the issue.

I have the following environment variables set to ``` LANG=fr_FR.UTF-8 LC_CTYPE=fr_FR.UTF-8 ``` The file utility reports a `ISO-8859 text` file type. Not saying that my terminal doesn't need fixing and that the issue is with ZNC, trying to get a correct understanding of the issue. <!-- github-comment-id:71443581 -->
Author
Owner

I see this happening when I try to open logs written by ZNC in GUI text editor, but no issues with terminal ones or cat.

I see this happening when I try to open logs written by ZNC in GUI text editor, but no issues with terminal ones or cat. <!-- github-comment-id:71450528 -->
Author
Owner

@Mikaela I reproduced it with vim until I forced the text encodings to UTF-8

@Mikaela I reproduced it with vim until I forced the text encodings to UTF-8 <!-- github-comment-id:71460021 -->
Author
Owner

cat only deals with bytes, it doesn't do any encoding, so LANG and LC_* are not relevant here - your terminal isn't parsing UTF-8 correctly without a BOM, maybe?

`cat` only deals with bytes, it doesn't do any encoding, so LANG and LC_\* are not relevant here - your terminal isn't parsing UTF-8 correctly without a BOM, maybe? <!-- github-comment-id:71799269 -->
Author
Owner

Which ZNC version? In 1.5/1.6b you can configure client and server encodings, and they will be applied on those borders, while internally it's UTF-8 everywhere.

Old charset module (up to 1.4) converted encoding, depending on where exactly in list of modules it is loaded, it's either before or after log module. In one case client→server will have wrong encoding, in another case server→client will have wrong encoding.

Which ZNC version? In 1.5/1.6b you can configure client and server encodings, and they will be applied on those borders, while internally it's UTF-8 everywhere. Old charset module (up to 1.4) converted encoding, depending on where exactly in list of modules it is loaded, it's either before or after log module. In one case client→server will have wrong encoding, in another case server→client will have wrong encoding. <!-- github-comment-id:72106055 -->
Author
Owner

Looks like it's ZNC 1.2
So that doesn't look like a real issue if up-to-date versions allow for encoding diddling.
Thank you for your answers !

Looks like it's ZNC 1.2 So that doesn't look like a real issue if up-to-date versions allow for encoding diddling. Thank you for your answers ! <!-- github-comment-id:72191255 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#458