Index: api/src/main/java/org/hippoecm/repository/api/StringCodecFactory.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- api/src/main/java/org/hippoecm/repository/api/StringCodecFactory.java (revision 45386) +++ api/src/main/java/org/hippoecm/repository/api/StringCodecFactory.java (revision ) @@ -48,12 +48,28 @@ } /** - * Requests which encoder to use for the givn symbolic name. + * Requests which encoder to use for the given symbolic name. * @param encoding the symbolic name of the encoder that is requested * @return the stringcodec to use, which might be a fall-back encoder or null if non was defined. */ public StringCodec getStringCodec(String encoding) { if (codecs.containsKey(encoding)) { + return codecs.get(encoding); + } else { + return codecs.get(null); + } + } + + /** + * Requests which encoder to use for the given symbolic name and locale + * @param encoding the symbolic name of the encoder that is requested + * @param locale the locale for the requested codec + * @return the stringcodec to use, which might be a fall-back encoder or null if non was defined. + */ + public StringCodec getStringCodec(String encoding, String locale) { + if (locale != null && codecs.containsKey(encoding + "." + locale)) { + return codecs.get(encoding+ "." + locale); + } else if (codecs.containsKey(encoding)) { return codecs.get(encoding); } else { return codecs.get(null);