Ya2yaml is a project mainly written in Ruby, based on the MIT license.
Ya2YAML is "yet another to_yaml". It emits YAML document with complete UTF8 support (string/binary detection, "u" escape sequences and Unicode specific line breaks).; forked from official tarball to fix bugs
= Ya2YAML - An UTF8 safe YAML dumper
Project Contact: Akira FUNAI mailto:[email protected]
Ya2YAML is "yet another to_yaml". It emits YAML document with complete UTF8 support (string/binary detection, "u" escape sequences and Unicode specific line breaks). I hope someone might find it useful until Syck/RbYAML come out with UTF8/16 support.
== Usage
code:
$KCODE = 'UTF8' require 'ya2yaml'
obj = [ "abc xyz ", "日本語 文字列 ", "xfdxfexff", ] puts obj.ya2yaml(:syck_compatible => true)
output:
== Method and Objects
When you require 'ya2yaml', public method 'Object#ya2yaml' is defined. Currently these Objects are supported.
as YAML generic types:
as Ruby specific types:
A String which contains any non-UTF8 character will be regarded as "binary" and encoded in BASE64.
== Options
obj.ya2yaml( :indent_size => 4, :hash_order => ['name','age','address'], :minimum_block_length => 16, :printable_with_syck => true, :escape_b_specific => true, :escape_as_utf8 => true )
obj.ya2yaml(:syck_compatible => true)
CAUTION Some of these options are to avoid compatibility issue with Syck. When you set these options to false, the emitted YAML document might not be loadable with YAML.load() although the syntax is valid.
:indent_size
:hash_order
:minimum_block_length
:printable_with_syck
:escape_b_specific
:escape_as_utf8
:syck_compatible
== More information
Visit http://rubyforge.org/projects/ya2yaml
== License
Ya2YAML is distributed with a MIT license, which can be found in the file LICENSE.