diff options
| author | Jeremy Evans <code@jeremyevans.net> | 2021-06-26 12:32:39 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-26 12:32:39 -0700 |
| commit | e86c1f6fc53433ef5c82ed2b7a4cc9a12c153e4c (patch) | |
| tree | c72cf93eaf31977d2cd80ecda12683c4017e3b55 /include/ruby/assert.h | |
| parent | 391abc543cea118a9cd7d6310acadbfa352668ef (diff) | |
Work around issue transcoding issue with non-ASCII compatible encodings and xml escaping
When using a non-ASCII compatible source and destination encoding
and xml escaping (the :xml option to String#encode), the resulting
string was broken, as it used the correct non-ASCII compatible
encoding, but contained data that was ASCII-compatible instead of
compatible with the string's encoding.
Work around this issue by detecting the case where both the
source and destination encoding are non-ASCII compatible, and
transcoding the source string from the non-ASCII compatible
encoding to UTF-8. The xml escaping code will correctly handle
the UTF-8 source string and the return the correctly encoded
and escaped value.
Fixes [Bug #12052]
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4605
Merged-By: jeremyevans <code@jeremyevans.net>
Diffstat (limited to 'include/ruby/assert.h')
0 files changed, 0 insertions, 0 deletions
