dump json into yaml

pyyaml.dump() has an allow_unicode option that defaults to None (all non-ASCII characters in the output are escaped). If allow_unicode=True, then it writes raw Unicode strings. yaml.dump(data, ff, allow_unicode=True) Bonus You can dump JSON without encoding as follows: json.dump(data, outfile, ensure_ascii=False)

Reading from property file containing utf 8 character

Use an InputStreamReader with Properties.load(Reader reader): FileInputStream input = new FileInputStream(new File(“uinsoaptest.properties”)); props.load(new InputStreamReader(input, Charset.forName(“UTF-8”))); As a method, this may resemble the following: private Properties read( final Path file ) throws IOException { final var properties = new Properties(); try( final var in = new InputStreamReader( new FileInputStream( file.toFile() ), StandardCharsets.UTF_8 ) ) { properties.load( … Read more