2 # Handle Unicode-to-Internal conversion
8 # Escape the string, condensing common escapes
10 def YAML.escape( value, skip = "" )
11 value.gsub( /\\/, "\\\\\\" ).
13 gsub( /([\x00-\x1f])/ ) do
14 skip[$&] || ESCAPES[ $&.unpack("C")[0] ]
19 # Unescape the condenses escapes
21 def YAML.unescape( value )
22 value.gsub( /\\(?:([nevfbart\\])|0?x([0-9a-fA-F]{2})|u([0-9a-fA-F]{4}))/ ) {
24 ["#$3".hex ].pack('U*')