Charset problem when playing buffer #833

Closed
opened 2026-10-05 04:47:15 +02:00 by adam · 10 comments
Owner

When I upgraded ZNC from 1.6.5 to 1.7.0, strange thing starts to happen. When I connected to my ZNC with AdiIRC, the buffer is garbled, looking like UTF-8 text interpreted as UTF-7. Real-time chat, query, backlog module, etc. seems like working as expected. Of course my server and client set to use only UTF-8 to communicate.

I'm not sure which one is to blame, but this problem disappears when I downgrade ZNC to 1.6.5. So it was my first choice to report this problem here.

When I upgraded ZNC from 1.6.5 to 1.7.0, strange thing starts to happen. When I connected to my ZNC with AdiIRC, the buffer is garbled, looking like UTF-8 text interpreted as UTF-**7**. Real-time chat, query, backlog module, etc. seems like working as expected. Of course my server and client set to use only UTF-8 to communicate. I'm not sure which one is to blame, but this problem disappears when I downgrade ZNC to 1.6.5. So it was my first choice to report this problem here. <!-- github-sync-id:320562186 -->
adam closed this issue 2026-10-05 04:47:15 +02:00
Author
Owner

Show exact output of znc --version. What modules are loaded? What encodings did you select for user and network in ZNC?

Show exact output of `znc --version`. What modules are loaded? What encodings did you select for user and network in ZNC? <!-- github-comment-id:386866826 -->
Author
Owner

I've compiled znc from tarball, on my Raspberry Pi running Debian buster. The output of $ znc --version is:

ZNC 1.7.0 - https://znc.in
IPv6: yes, SSL: yes, DNS: threads, charset: yes, i18n: no, build: autoconf

Part of my znc.conf follows:

AnonIPLimit = 5
AuthOnlyViaModule = false
ConfigWriteDelay = 0
ConnectDelay = 5
HideVersion = true
LoadModule = webadmin
LoadModule = adminlog
LoadModule = backlog
LoadModule = modpython
LoadModule = weblog
LoadModule = block_motd
MaxBufferSize = 500
ProtectWebSessions = false
SSLCertFile = /home/znc/.znc/znc.pem
SSLDHParamFile = /home/znc/.znc/znc.pem
SSLKeyFile = /home/znc/.znc/znc.pem
ServerThrottle = 30
Skin = _default_
StatusPrefix = *
Version = 1.7.0

<Listener listener0>
        AllowIRC = true
        AllowWeb = false
        IPv4 = true
        IPv6 = false
        Port = 6667
        SSL = true
        URIPrefix = /
</Listener>

<Listener listener1>
        AllowIRC = false
        AllowWeb = true
        IPv4 = true
        IPv6 = false
        Port = 8082
        SSL = true
        URIPrefix = /
</Listener>

<User irtc1015>
        Admin = true
        Allow = *
        AltNick = I110_Gyeyang_
        AppendTimestamp = false
        AuthOnlyViaModule = false
        AutoClearChanBuffer = true
        AutoClearQueryBuffer = true
        ChanBufferSize = 100
        ClientEncoding = utf-8
        DenyLoadMod = false
        DenySetBindHost = false
        Ident = IRTC1015
        JoinTries = 10
        LoadModule = log
        LoadModule = alias
        LoadModule = controlpanel
        MaxJoins = 5
        MaxNetworks = 5
        MaxQueryBuffers = 0
        MultiClients = true
        Nick = I110_Gyeyang
        NoTrafficTimeout = 180
        PrependTimestamp = true
        QueryBufferSize = 50
        QuitMsg = Disconnecting
        RealName = IRTC1015 aka I110_Gyeyang, powered by ZNC
        TimestampFormat = [%H:%M:%S]

        <Network default>
                Encoding = UTF-8
                FloodBurst = 4
                FloodRate = -1.00
                IRCConnectEnabled = true
                JoinDelay = 2
                LoadModule = sasl
                LoadModule = push
                LoadModule = keepnick
                LoadModule = kickrejoin
                LoadModule = simple_away
                LoadModule = route_replies
                LoadModule = autoattach
                LoadModule = stickychan
                LoadModule = watch
                QuitMsg = Shutting Down...
                Server = chat.freenode.net +6697
                TrustAllCerts = false
                TrustPKI = true
        </Network>
</User>
I've compiled znc from tarball, on my Raspberry Pi running Debian buster. The output of $ znc --version is: ``` ZNC 1.7.0 - https://znc.in IPv6: yes, SSL: yes, DNS: threads, charset: yes, i18n: no, build: autoconf ``` Part of my znc.conf follows: ``` AnonIPLimit = 5 AuthOnlyViaModule = false ConfigWriteDelay = 0 ConnectDelay = 5 HideVersion = true LoadModule = webadmin LoadModule = adminlog LoadModule = backlog LoadModule = modpython LoadModule = weblog LoadModule = block_motd MaxBufferSize = 500 ProtectWebSessions = false SSLCertFile = /home/znc/.znc/znc.pem SSLDHParamFile = /home/znc/.znc/znc.pem SSLKeyFile = /home/znc/.znc/znc.pem ServerThrottle = 30 Skin = _default_ StatusPrefix = * Version = 1.7.0 <Listener listener0> AllowIRC = true AllowWeb = false IPv4 = true IPv6 = false Port = 6667 SSL = true URIPrefix = / </Listener> <Listener listener1> AllowIRC = false AllowWeb = true IPv4 = true IPv6 = false Port = 8082 SSL = true URIPrefix = / </Listener> <User irtc1015> Admin = true Allow = * AltNick = I110_Gyeyang_ AppendTimestamp = false AuthOnlyViaModule = false AutoClearChanBuffer = true AutoClearQueryBuffer = true ChanBufferSize = 100 ClientEncoding = utf-8 DenyLoadMod = false DenySetBindHost = false Ident = IRTC1015 JoinTries = 10 LoadModule = log LoadModule = alias LoadModule = controlpanel MaxJoins = 5 MaxNetworks = 5 MaxQueryBuffers = 0 MultiClients = true Nick = I110_Gyeyang NoTrafficTimeout = 180 PrependTimestamp = true QueryBufferSize = 50 QuitMsg = Disconnecting RealName = IRTC1015 aka I110_Gyeyang, powered by ZNC TimestampFormat = [%H:%M:%S] <Network default> Encoding = UTF-8 FloodBurst = 4 FloodRate = -1.00 IRCConnectEnabled = true JoinDelay = 2 LoadModule = sasl LoadModule = push LoadModule = keepnick LoadModule = kickrejoin LoadModule = simple_away LoadModule = route_replies LoadModule = autoattach LoadModule = stickychan LoadModule = watch QuitMsg = Shutting Down... Server = chat.freenode.net +6697 TrustAllCerts = false TrustPKI = true </Network> </User> ``` <!-- github-comment-id:386867389 -->
Author
Owner

1
This is a screenshot from my PC running AdiIRC. The texts in quotes are intended to be exactly same, saying "안녕하세요", whitten in Korean alphabet.

![1](https://user-images.githubusercontent.com/39018742/39672159-e083ca4a-515f-11e8-98a9-52476efa8d10.png) This is a screenshot from my PC running AdiIRC. The texts in quotes are intended to be exactly same, saying "안녕하세요", whitten in Korean alphabet. <!-- github-comment-id:386868116 -->
Author
Owner

How did you detect this as UTF-7?
Does znc -D show anything interesting during playback or before?

How did you detect this as UTF-7? Does `znc -D` show anything interesting during playback or before? <!-- github-comment-id:387314948 -->
Author
Owner

Nothing but bunch of PRIVMSGs. Strangely, other clients(I've tried HexChat and AndroIRC) don't seem to have charset problem with buffer. As far as I can see from the console, the buffer data itself seems to be correct UTF-8.

I've tried saving bunch of text as UTF-8 file and opening it as UTF-7. I got similar result with one from AdiIRC; for example, "안녕하세요" becomes "안녕하세요", just like you can see from the screenshot.

So it can be a bug of only AdiIRC, not of ZNC. What I want to know is what makes AdiIRC behave like that, as it never happened before I installed ZNC 1.7.0.

Nothing but bunch of PRIVMSGs. Strangely, other clients(I've tried HexChat and AndroIRC) don't seem to have charset problem with buffer. As far as I can see from the console, the buffer data itself seems to be correct UTF-8. I've tried saving bunch of text as UTF-8 file and opening it as UTF-7. I got similar result with one from AdiIRC; for example, "안녕하세요" becomes "안녕하세요", just like you can see from the screenshot. So it can be a bug of only AdiIRC, not of ZNC. What I want to know is what makes AdiIRC behave like that, as it never happened before I installed ZNC 1.7.0. <!-- github-comment-id:387323302 -->
Author
Owner

No idea... Try to use wireshark or tcpdump to see what encoding it sends during buffer playback.

No idea... Try to use wireshark or tcpdump to see what encoding it sends during buffer playback. <!-- github-comment-id:387466359 -->
Author
Owner

Aargh, Wireshark gave me answer...

Packet from 1.7.0 have "batch" in message(which doesn't appear in one from old version...it's IRCv3 implementation, right?). This is something changed in 1.7.0, and which I wanted to know. IT was something that AdiIRC handles wrong. To tell the truth, the bug seems to be already fixed in beta version of AdiIRC(which I never tried).

I'm sorry for making you spend some time for me.

Aargh, Wireshark gave me answer... Packet from 1.7.0 have "batch" in message(which doesn't appear in one from old version...it's IRCv3 implementation, right?). This is something changed in 1.7.0, and which I wanted to know. IT was something that AdiIRC handles wrong. To tell the truth, the bug seems to be already fixed in beta version of AdiIRC(which I never tried). I'm sorry for making you spend some time for me. <!-- github-comment-id:387491564 -->
Author
Owner

How does batch cause UTF-7 though?
"batch" is implemented now, but it's not sent unless client requests it...
which it does.

2018-05-08 19:07 GMT+01:00 IRTC1015 notifications@github.com:

Aargh, Wireshark gave me answer...

Packet from 1.7.0 have "batch" in message(which doesn't appear in one from
old version...it's IRCv3 implementation, right?). This is something changed
in 1.7.0, and which I wanted to know. IT was something that AdiIRC handles
wrong. To tell the truth, the bug seems to be already fixed in beta version
of AdiIRC(which I never tried).

I'm sorry for making you spend some time for me.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/znc/znc/issues/1526#issuecomment-387491564, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAT15CP4Fx7kF1B-e4Gl07ah1QW8KsNvks5twd7WgaJpZM4Tz5E-
.

How does batch cause UTF-7 though? "batch" is implemented now, but it's not sent unless client requests it... which it does. 2018-05-08 19:07 GMT+01:00 IRTC1015 <notifications@github.com>: > Aargh, Wireshark gave me answer... > > Packet from 1.7.0 have "batch" in message(which doesn't appear in one from > old version...it's IRCv3 implementation, right?). This is something changed > in 1.7.0, and which I wanted to know. IT was something that AdiIRC handles > wrong. To tell the truth, the bug seems to be already fixed in beta version > of AdiIRC(which I never tried). > > I'm sorry for making you spend some time for me. > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > <https://github.com/znc/znc/issues/1526#issuecomment-387491564>, or mute > the thread > <https://github.com/notifications/unsubscribe-auth/AAT15CP4Fx7kF1B-e4Gl07ah1QW8KsNvks5twd7WgaJpZM4Tz5E-> > . > <!-- github-comment-id:387504199 -->
Author
Owner

I have no idea. They just marked it as resolved without further explanation. Who on earth uses UTF-7 anyway?

I have no idea. They just marked it as resolved [without further explanation](https://dev.adiirc.com/issues/3846). Who on earth uses UTF-7 anyway? <!-- github-comment-id:387508753 -->
Author
Owner

Well, good that it's resolved.
Btw, batch would be visible in znc -D too.

Well, good that it's resolved. Btw, batch would be visible in `znc -D` too. <!-- github-comment-id:387512334 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#833