ros-infrastructure/rospkg — pull request #54 by cottsay (2014-02-05 00:57:10+00:00)
Title: Use system encoding to read os version

Fedora 19 brought us the *wonderful* gift of special characters in the release name. Without specifying the encoding, the release file is read as ASCII (the Python 2 default) and can be wrong. We can use locale to detect the system's preferred encoding and read the file as such.

This problem prevents rosdep or any other ROS entity which uses this value from working correctly in Fedora 19.

locale.getpreferredencoding() was added in Python 2.3.

This should be tested on Ubuntu and OSX, but I can't see how using the system's encoding will result in a different string for OSs where the issue file has none of the extended characters.