From 06e3ca2d370c00a8c557b7408c88159c77bd951f Mon Sep 17 00:00:00 2001 From: Rodney Waldhoff Date: Fri, 18 Apr 2003 23:17:09 +0000 Subject: [PATCH] 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 --- .../collections/ExtendedProperties.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/java/org/apache/commons/collections/ExtendedProperties.java b/src/java/org/apache/commons/collections/ExtendedProperties.java index 55cef82dc..d4b7b54b7 100644 --- a/src/java/org/apache/commons/collections/ExtendedProperties.java +++ b/src/java/org/apache/commons/collections/ExtendedProperties.java @@ -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 @@ -158,7 +158,7 @@ import java.util.Vector; * it, go ahead and tune it up! * * @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 Stefano Mazzocchi * @author Jon S. Stevens @@ -472,14 +472,23 @@ public class ExtendedProperties extends Hashtable } catch (UnsupportedEncodingException e) { - // Get one with the default encoding... + // Another try coming up.... } } if (reader == null) { - reader = - new PropertiesReader(new InputStreamReader(input)); + try + { + reader = + 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