More fixes for UTF-8 encoding issues (bug #971417).

This commit is contained in:
Tim Waugh 2013-06-06 17:13:29 +01:00
parent b9ed62ad94
commit eaa64591ea
2 changed files with 73 additions and 6 deletions

View File

@ -0,0 +1,65 @@
diff -up system-config-printer-1.4.1/newprinter.py.utf8-971417 system-config-printer-1.4.1/newprinter.py
--- system-config-printer-1.4.1/newprinter.py.utf8-971417 2013-06-06 17:11:08.781804207 +0100
+++ system-config-printer-1.4.1/newprinter.py 2013-06-06 17:11:46.179991962 +0100
@@ -1632,7 +1632,7 @@ class NewPrinterGUI(GtkGUI):
def on_entNPName_changed(self, widget):
# restrict
- text = unicode (widget.get_text(), locale.getpreferredencoding ())
+ text = unicode (widget.get_text(), 'utf-8')
new_text = text
new_text = new_text.replace("/", "")
new_text = new_text.replace("#", "")
@@ -2513,10 +2513,10 @@ class NewPrinterGUI(GtkGUI):
def entry_changed(self, entry, allowed_chars):
"Remove all chars from entry's text that are not in allowed_chars."
try:
- allowed_chars = unicode (allowed_chars, locale.getpreferredencoding())
+ allowed_chars = unicode (allowed_chars, 'utf-8')
except UnicodeDecodeError:
allowed_chars = unicode (allowed_chars)
- origtext = unicode (entry.get_text(), locale.getpreferredencoding ())
+ origtext = unicode (entry.get_text(), 'utf-8')
new_text = origtext
for char in origtext:
if char not in allowed_chars:
@@ -3883,10 +3883,9 @@ class NewPrinterGUI(GtkGUI):
self.dec_spinner_task ()
if self.dialog_mode in ("class", "printer", "printer_with_uri"):
- enc = locale.getpreferredencoding ()
- name = unicode (self.entNPName.get_text(), enc)
- location = unicode (self.entNPLocation.get_text(), enc)
- info = unicode (self.entNPDescription.get_text(), enc)
+ name = unicode (self.entNPName.get_text(), 'utf-8')
+ location = unicode (self.entNPLocation.get_text(), 'utf-8')
+ info = unicode (self.entNPDescription.get_text(), 'utf-8')
else:
name = self._name
diff -up system-config-printer-1.4.1/printerproperties.py.utf8-971417 system-config-printer-1.4.1/printerproperties.py
--- system-config-printer-1.4.1/printerproperties.py.utf8-971417 2013-06-06 17:11:08.776804182 +0100
+++ system-config-printer-1.4.1/printerproperties.py 2013-06-06 17:11:46.179991962 +0100
@@ -688,7 +688,7 @@ class PrinterPropertiesDialog(GtkGUI):
old_value = old_values[widget]
if type (old_value) == unicode:
- old_value = old_value.encode (locale.getpreferredencoding ())
+ old_value = old_value.encode ('utf-8')
if old_value == value:
self.changed.discard(widget)
@@ -1041,10 +1041,9 @@ class PrinterPropertiesDialog(GtkGUI):
for member in old_members:
self.cups.deletePrinterFromClass(member, name)
- enc = locale.getpreferredencoding ()
- location = self.entPLocation.get_text().decode (enc)
- info = self.entPDescription.get_text().decode (enc)
- device_uri = self.entPDevice.get_text().decode (enc)
+ location = self.entPLocation.get_text().decode ('utf-8')
+ info = self.entPDescription.get_text().decode ('utf-8')
+ device_uri = self.entPDevice.get_text().decode ('utf-8')
enabled = self.chkPEnabled.get_active()
accepting = self.chkPAccepting.get_active()

View File

@ -13,8 +13,9 @@ Patch4: system-config-printer-utf8-964673.patch
Patch5: system-config-printer-utf8-965578.patch
Patch6: system-config-printer-utf8-965771.patch
Patch7: system-config-printer-utf8-969846.patch
Patch8: system-config-printer-typo.patch
Patch9: system-config-printer-notify-urgency.patch
Patch8: system-config-printer-utf8-971417.patch
Patch9: system-config-printer-typo.patch
Patch10: system-config-printer-notify-urgency.patch
BuildRequires: cups-devel >= 1.2
BuildRequires: desktop-file-utils >= 0.2.92
@ -77,19 +78,20 @@ printers.
%patch1 -p1 -b .no-applet-in-gnome
# Fixes for UTF-8 encoding issues (bug #957444, bug #961882,
# bug #962207, bug #964673, bug #965578).
# bug #962207, bug #964673, bug #965578, bug #969846, bug #971417).
%patch2 -p1 -b .utf8-961882
%patch3 -p1 -b .utf8-962207
%patch4 -p1 -b .utf8-964673
%patch5 -p1 -b .utf8-965578
%patch6 -p1 -b .utf8-965771
%patch7 -p1 -b .utf8-969846
%patch8 -p1 -b .utf8-971417
# Fixed typo which could cause a traceback (bug #965678).
%patch8 -p1 -b .typo
%patch9 -p1 -b .typo
# Notify urgencies have new names with gi.repository (bug #970646).
%patch9 -p1 -b .notify-urgency
%patch10 -p1 -b .notify-urgency
%build
%configure --with-udev-rules
@ -192,7 +194,7 @@ exit 0
%changelog
* Thu Jun 6 2013 Tim Waugh <twaugh@redhat.com> 1.4.1-4
- Notify urgencies have new names with gi.repository (bug #970646).
- More fixes for UTF-8 encoding issues (bug #969846).
- More fixes for UTF-8 encoding issues (bug #969846, bug #971417).
* Wed May 22 2013 Tim Waugh <twaugh@redhat.com> 1.4.1-3
- Fixed typo introduced in previous change (for bug #962207), and