address bug 17616, default to ISO-8859-1 encoding when none specified

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@131022 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Rodney Waldhoff 2003-04-18 23:17:09 +00:00
parent 9fb7c31640
commit 06e3ca2d37
1 changed files with 14 additions and 5 deletions

View File

@ -1,5 +1,5 @@
/* /*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/ExtendedProperties.java,v 1.9 2003/02/19 20:14:25 scolebourne Exp $ * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/ExtendedProperties.java,v 1.10 2003/04/18 23:17:09 rwaldhoff Exp $
* ==================================================================== * ====================================================================
* *
* The Apache Software License, Version 1.1 * The Apache Software License, Version 1.1
@ -158,7 +158,7 @@ import java.util.Vector;
* it, go ahead and tune it up! * it, go ahead and tune it up!
* *
* @since 1.0 * @since 1.0
* @version $Revision: 1.9 $ $Date: 2003/02/19 20:14:25 $ * @version $Revision: 1.10 $ $Date: 2003/04/18 23:17:09 $
* *
* @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a> * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
* @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a> * @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
@ -472,14 +472,23 @@ public class ExtendedProperties extends Hashtable
} }
catch (UnsupportedEncodingException e) catch (UnsupportedEncodingException e)
{ {
// Get one with the default encoding... // Another try coming up....
} }
} }
if (reader == null) if (reader == null)
{
try
{ {
reader = reader =
new PropertiesReader(new InputStreamReader(input)); new PropertiesReader(new InputStreamReader(input,"8859_1"));
}
catch (UnsupportedEncodingException e)
{
// ISO8859-1 support is required on java platforms but....
// If it's not supported, use the system default encoding
reader = new PropertiesReader(new InputStreamReader(input));
}
} }
try try