← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2322: Minor fix.

 

------------------------------------------------------------
revno: 2322
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: trunk
timestamp: Wed 2010-10-06 11:54:37 +0700
message:
  Minor fix.
modified:
  dhis-2/dhis-services/dhis-service-i18n/src/main/java/org/hisp/dhis/i18n/resourcebundle/DefaultResourceBundleManager.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-i18n/src/main/java/org/hisp/dhis/i18n/resourcebundle/DefaultResourceBundleManager.java'
--- dhis-2/dhis-services/dhis-service-i18n/src/main/java/org/hisp/dhis/i18n/resourcebundle/DefaultResourceBundleManager.java	2010-10-05 06:45:43 +0000
+++ dhis-2/dhis-services/dhis-service-i18n/src/main/java/org/hisp/dhis/i18n/resourcebundle/DefaultResourceBundleManager.java	2010-10-06 04:54:37 +0000
@@ -32,6 +32,7 @@
 import java.io.IOException;
 import java.net.JarURLConnection;
 import java.net.URL;
+import java.net.URLDecoder;
 import java.util.Collection;
 import java.util.Enumeration;
 import java.util.HashSet;
@@ -229,17 +230,14 @@
 
     private String convertURLToFilePath( String url )
     {
-        return url.replaceAll( "%20", " " )
-                .replaceAll( "%21", "!" ).replaceAll( "%22", "\"" )
-                .replaceAll( "%23", "#" ).replaceAll( "%24", "$" )
-                .replaceAll( "%25", "%" ).replaceAll( "%26", "&" )
-                .replaceAll( "%27", "\'").replaceAll( "%28", "(" )
-                .replaceAll( "%29", ")" ).replaceAll( "%2a", "*" )
-                .replaceAll( "%2b", "+" ).replaceAll( "%2c", "," )
-                .replaceAll( "%2d", "-" ).replaceAll( "%2e", "." )
-                .replaceAll( "%2f", "/" ).replaceAll( "%3a", ":" )
-                .replaceAll( "%3b", ";" ).replaceAll( "%3c", "<" )
-                .replaceAll( "%3d", "=" ).replaceAll( "%3e", ">" )
-                .replaceAll( "%3f", "?" ).replaceAll( "%40", "@" );
+        try
+        {
+            url = URLDecoder.decode( url, "iso-8859-1" );
+        }
+        catch ( Exception ex )
+        {
+            ex.printStackTrace();
+        }
+        return url;
     }
 }