character encoding - karaf configuration property is garbled -
i implement org.osgi.service.cm.managedservice interface karaf configuration. when give chinese value property, garbled.initially, files in etc folder encoded in latin1. have tried set utf-8 encoding, has no effect. can me?
in karaf, configurations files (ie etc/*.cfg
) handled felix subproject "fileinstall".
fileinstall doesn't support yet specified custom character encoding configuration, uses properties
class , properties.load(inputstream)
, documents:
the load(reader) / store(writer, string) methods load , store properties , character based stream in simple line-oriented format specified below. load(inputstream) / store(outputstream, string) methods work same way load(reader)/store(writer, string) pair, except input/output stream encoded in iso 8859-1 character encoding. characters cannot directly represented in encoding can written using unicode escapes defined in section 3.3 of java™ language specification; single 'u' character allowed in escape sequence. native2ascii tool can used convert property files , other character encodings.
so, have encode file in ise-8859-1 , quote every utf character, or use xml file encode configuration files.
Comments
Post a Comment