PropertiesFileParserImpl implements PropertiesFileParser { public Map<String, String> parsePropertiesFile(Resource resource) throws IOException { Map<String, String> result = CollectionFactory.newCaseInsensitiveMap(); Properties p = new Properties(); InputStream is = null; try { is = readUTFStreamToEscapedASCII(resource.openStream()); p.load(is); is.close(); is = null; } finally { InternalUtils.close(is); } for (Map.Entry e : p.entrySet()) { String key = e.getKey().toString(); String value = p.getProperty(key); result.put(key, value); } return result; }  Map<String, String> parsePropertiesFile(Resource resource);  }
@Test public void read_utf() throws Exception { Resource utf8 = new ClasspathResource("org/apache/tapestry5/internal/services/messages/utf8.properties"); PropertiesFileParser parser = getService(PropertiesFileParser.class); Map<String, String> properties = parser.parsePropertiesFile(utf8); assertEquals(properties.get("tapestry"), "\u30bf\u30da\u30b9\u30c8\u30ea\u30fc"); assertEquals(properties.get("version"), "5"); }