8139216: Non-ASCII characters in CUPS printer names are not properly displayed

Reviewed-by: prr, rchamyal
This commit is contained in:
Prasanta Sadhukhan 2015-11-03 14:00:01 +03:00
parent e0f0f10478
commit a2b313cb84

View File

@ -321,7 +321,11 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
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 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
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;