HomePhorge

(PUP-1473) Fix issue with UTF-8 in user comments
065c4f5b5c78Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(PUP-1473) Fix issue with UTF-8 in user comments

GH-1943 included a change to munge the comment property on the user
type so that it gets encoded as ASCII-8BIT. This was to allow the comment
property to handle UTF-8 values as existing values are read as ASCII-8BIT.

Originally the change called force_encoding to force the encoding to
ASCII-8BIT. This method does not actually attempt to encode the string, it
only changes the string's associated encoding. It was suggested during code
review that a call to encode should be used instead. However, calling
encode will fail if the string has UTF-8 characters that cannot be
represented in ASCII-8BIT.

As we desire the comment property to be treated as a squence of bytes in
this case, we should be calling force_encoding instead of encode.

Details

Provenance
Peter Huene <peter.huene@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU12d9ab939679: Merge pull request #2343 from nfagerlund/docs_exec_logoutput
Branches
Unknown
Tags
Unknown

Event Timeline

Peter Huene <peter.huene@puppetlabs.com> committed rPU065c4f5b5c78: (PUP-1473) Fix issue with UTF-8 in user comments (authored by Peter Huene <peter.huene@puppetlabs.com>).Feb 10 2014, 10:38 PM