No option to use yaml_emitter_set_unicode

Bug #1279042 reported by Ashwin Purohit
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
goyaml
New
Undecided
Unassigned

Bug Description

There is no option to use yaml_emitter_set_unicode, although it is defined in encode.go. That means when I have an input file like:

line: 你好

And I unmarshal and re-marshal it, when I write it to a file I will get:

line: "\u4F60\u597D"

which is unexpected -- I prefer the unescaped version.

When I add this line as L20 in encoder.go:

yaml_emitter_set_unicode(&e.emitter, true)

The problem is resolved, and line: 你好 displays normally on output. At the very least, there should be an option to yaml_emitter_set_unicode(..., true), otherwise I have to keep a forked repo!

Tags: unicode
Ashwin Purohit (purohit)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.