[Q] PyYAML: encoding option of yaml.dump()
"Makoto Kuwata" <[email protected]>
| Newsgroups | gmane.text.yaml.general |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I have question about encoding option of yaml.dump() of PyYAML.
I tried the following python script, and got '"\u30DD\u30B1\u30E2\u30F3"'
as a result, thought what I expect is utf8 characters, not escaped sequence.
import yaml
data = [u'\u30dd\u30b1\u30e2\u30f3']
print yaml.dump(data, default_flow_style=False)
print yaml.dump(data, default_flow_style=False, encoding='utf8')
## (result)
## - "\u30DD\u30B1\u30E2\u30F3"
## - "\u30DD\u30B1\u30E2\u30F3"
## (expected)
## - "\u30DD\u30B1\u30E2\u30F3"
## - XXXX # japanese characters in utf8
Is it possible to get utf8 characters using yaml.dump() ?
--
makoto kuwata
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/