8139216: Non-ASCII characters in CUPS printer names are not properly displayed
Reviewed-by: prr, rchamyal
--- a/jdk/src/java.desktop/unix/classes/sun/print/IPPPrintService.java Mon Nov 02 17:52:40 2015 +0400
+++ b/jdk/src/java.desktop/unix/classes/sun/print/IPPPrintService.java Tue Nov 03 14:00:01 2015 +0300
@@ -321,7 +321,11 @@
if ((name == null) || (url == null)){
throw new IllegalArgumentException("null uri or printer name");
}
- printer = name;
+ try {
+ printer = java.net.URLDecoder.decode(name, "UTF-8");
+ } catch (java.io.UnsupportedEncodingException e) {
+ printer = name;
+ }
supportedDocFlavors = null;
supportedCats = null;
mediaSizeNames = null;
@@ -351,7 +355,11 @@
if ((name == null) || (uriStr == null)){
throw new IllegalArgumentException("null uri or printer name");
}
- printer = name;
+ try {
+ printer = java.net.URLDecoder.decode(name, "UTF-8");
+ } catch (java.io.UnsupportedEncodingException e) {
+ printer = name;
+ }
supportedDocFlavors = null;
supportedCats = null;
mediaSizeNames = null;