Issue #22848 has been updated by Charlie Sharpsteen.

Status changed from Needs More Information to Investigating

Researched this a bit. Both the packaging guidelines for the [Debian 
project](http://fedoraproject.org/wiki/Packaging:Guidelines#Encoding) and the 
[Fedora project](http://www.debian.org/doc/debian-policy/ch-controlfields.html) 
specify that the metadata files should be UTF-8 encoded. However, neither the 
dpkg or rpm toolchains actually enforce these guidelines. Thus, it is perfectly 
possible to have `.rpm` and `.deb` packages which contain metadata strings that 
do not match the system locale or a default such as UTF-8.

Therefore, we can't use `force_encoding "UTF-8"` to work around this as we 
cannot assume that the output of `dpkg` or `rpm` will always be in UTF-8. The 
example below shows how strings that break this assumption will cause problems 
despite the use of `force_encoding`:

<pre>
[1] pry(main)> RUBY_VERSION
=> "1.9.3"
[2] pry(main)> test_str = "Blue \xE9yster Cult"
=> "Blue \xE9yster Cult"
[3] pry(main)> test_str.force_encoding 'UTF-8'
=> "Blue \xE9yster Cult"
[4] pry(main)> test_str.encoding
=> #<Encoding:UTF-8>
[5] pry(main)> test_str =~ /Blue/
ArgumentError: invalid byte sequence in UTF-8
from (pry):5:in `__pry__'
</pre>

----------------------------------------
Bug #22848: Encoding mis-matches cause package prefetching to fail
https://projects.puppetlabs.com/issues/22848#change-101043

* Author: Jos Backus
* Status: Investigating
* Priority: High
* Assignee: 
* Category: ruby19
* Target version: 
* Affected Puppet version: 3.3.1
* Keywords: utf8 encoding package customer
* Branch: 
----------------------------------------
One of our RPM packages has some UTF-8 characters in its description, leading 
to an exception ("Error: Could not prefetch package provider 'yum': invalid 
byte sequence in US-ASCII")  in rpm.rb, causing no packages to be upgraded as 
the yumhelper.py invocation code raises that error.

Priority=High because it breaks file { ensure => latest; }.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to