slapd.scripts-common: Avoid double-UTF8-encoding org name (Closes: #1016185)
The postinst
maintscript of slapd incorrectly encodes organization names
with non-ASCII characters.
The issue is that values received from debconf (already in UTF-8) are
encoded once again via the function encode_utf8
.
This turns
"pé" (0x70 0xC3 0xA9 = U+0070, U+00E9)
into
"pé" (0x70 0xC3 0x8e 0xC2 0xA9 = U+0070, U+00C3, U+00A9)
The are two possible scenarios:
-
If one assumes that the string returned by debconf is UTF-8 encoded (that is the case in all modern setups), then there is no need for another round of encoding.
-
If instead, one assumes that the string returned by debconf is not UTF-8 encoded, then one should also know which encoding it is in, in order to perform the right conversion.
The current code produces wrong results in both cases.
Edited by Gioele Barabucci