HomePhorge

Fix #5261 Don't escape Unicode characters in PSON
095675711a89Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Fix #5261 Don't escape Unicode characters in PSON

This patch removes the escaping of valid UTF-8 sequences as "\uXXXX".
This code was unreliable, as it relied on Iconv's ability to convert
those codepoints between UTF-8 and UTF-16, but some versions of Iconv
barf on some valid codepoints.

Invalid UTF-8 sequences are still passed through unchanged. We believe
that this is fine; if you are concerned about complience with the JSON
standard, what we are doing is equivalent to:

  • interpreting binary files as Latin-1 encoded character sequences
  • JSON-encoding those characters according to RFC 4627
  • outputting the JSON as Latin-1

This allows all raw binary files to be transmitted losslessly.

Paired-With: Paul Berry <paul@puppetlabs.com>

Details

Provenance
Jesse Wolfe <jes5199@gmail.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU53bb805f118c: Incremented CHANGELOG for 2.6.3
Branches
Unknown
Tags
Unknown

Event Timeline

Jesse Wolfe <jes5199@gmail.com> committed rPU095675711a89: Fix #5261 Don't escape Unicode characters in PSON (authored by Jesse Wolfe <jes5199@gmail.com>).Nov 23 2010, 12:31 AM