Skip to content

UTF-8 strings stored as binary, load as ASCII-8BIT #14

@ghazel

Description

@ghazel

Some valid UTF-8 strings lose their encoding when passed through YAML:

2.2.1 :001 > "\xEF\xBF\xBD\x1F".encoding
 => #<Encoding:UTF-8> 
2.2.1 :002 > "\xEF\xBF\xBD\x1F".valid_encoding?
 => true 
2.2.1 :003 > "\xEF\xBF\xBD\x1F".to_yaml
 => "--- !binary |\n77+9Hw==\n\n" 
2.2.1 :004 > YAML.load("\xEF\xBF\xBD\x1F".to_yaml).encoding
 => #<Encoding:ASCII-8BIT> 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions