From bc91ac8077c72ff2a0a9647d383ad9f537aeb741 Mon Sep 17 00:00:00 2001 From: Pedro Fialho Date: Sun, 28 Jan 2024 09:54:46 -0500 Subject: [PATCH] decode unicode as ascii --- pkg/ipmi/id_string.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/ipmi/id_string.go b/pkg/ipmi/id_string.go index 893998e..a94ab77 100644 --- a/pkg/ipmi/id_string.go +++ b/pkg/ipmi/id_string.go @@ -68,7 +68,9 @@ var ( // turning them into Go strings. These functions are not implemented inline // to ease readability and testability stringEncodingDecoders = map[StringEncoding]StringDecoder{ - // no decoder for StringEncodingUnicode, as ambiguous + // despite the ambiguity of StringEncodingUnicode, we follow OpenIPMI + // and decode it as 8-bit ASCII + StringEncodingUnicode: StringDecoderFunc(decode8BitAsciiLatin1), StringEncodingBCDPlus: StringDecoderFunc(decodeBCDPlus), StringEncodingPacked6BitAscii: StringDecoderFunc(decodePacked6BitAscii), StringEncoding8BitAsciiLatin1: StringDecoderFunc(decode8BitAsciiLatin1),