< prev index next >

src/java.desktop/unix/classes/sun/print/IPPPrintService.java

Print this page

        

@@ -319,11 +319,15 @@
 
     IPPPrintService(String name, URL url) {
         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) {
+            System.out.println("Unsupported Encoding Exception");
+        }
         supportedDocFlavors = null;
         supportedCats = null;
         mediaSizeNames = null;
         customMediaSizeNames = null;
         mediaTrays = null;

@@ -349,20 +353,25 @@
 
     IPPPrintService(String name, String uriStr, boolean isCups) {
         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) {
+            System.out.println("Unsupported Encoding Exception");
+        }
         supportedDocFlavors = null;
         supportedCats = null;
         mediaSizeNames = null;
         customMediaSizeNames = null;
         mediaTrays = null;
         cps = null;
         init = false;
         defaultMediaIndex = -1;
         try {
+            
             myURL =
                 new URL(uriStr.replaceFirst("ipp", "http"));
         } catch (Exception e) {
             IPPPrintService.debug_println(debugPrefix+
                                           " IPPPrintService, myURL="+
< prev index next >