leodido / go-syslog

Blazing fast syslog parsers
MIT License
31 stars 3 forks source link

rfc5424: unicode param values are improperly encoded #19

Closed tdakkota closed 2 months ago

tdakkota commented 2 months ago

Reproducer:

        msg := new(SyslogMessage)
        msg.SetPriority(1)
        msg.SetVersion(1)
        msg.SetTimestamp(time.Now().Format(time.RFC3339))
        msg.SetMessage("hello")
        msg.SetParameter("general@0", "payload", `🇺🇬👁️‍🗨️`)
        fmt.Println(msg.String())

yields broken Unicode

<1>1 2024-09-18T15:24:32+03:00 - - - - [general@0 payload="ðððïâðï"] hello