Ticket #7 (new defect)

Opened 3 years ago

Last modified 2 years ago

1.8.4 yaml converts utf8 to binary instead of keeping it utf8 as in 1.8.2

Reported by: anonymous Owned by: somebody
Priority: major Milestone: milestone1
Component: component1 Version: 2.0
Keywords: utf-8 unicode utf8 binary Cc:

Description

This bug makes it so that a file cannot be yamlized, transferred to another machine, and un-yamlized. (for example, from a 64-bit server machine to a 32-bit dev machine)

It says object expected, but got a string.

To reproduce: for 1.8.4

a = {}

=> {}

a[:tags] = ['序部署应用', '序部署应用']

=> ["序部署应用", "序部署应用"]

a.to_yaml

=> "--- \n:tags: \n- !binary |\n 5bqP6YOo572y5bqU55So\n\n- !binary |\n 5bqP6YOo572y5bqU55So\n\n"

b = a[:tags]

=> ["序部署应用", "序部署应用"]

b.to_yaml

=> "--- \n- !binary |\n 5bqP6YOo572y5bqU55So\n\n- !binary |\n 5bqP6YOo572y5bqU55So\n\n"

b[0].to_yaml

=> "--- !binary |\n5bqP6YOo572y5bqU55So\n\n"

for 1.8.2: (more portable way)

a = {}

a = {}

=> {}

a[:tags] = ['序部署应用', '序部署应用']

=> ["序部署应用", "序部署应用"]

a.to_yaml

=> "--- \n:tags: \n - \"序部署应用\"\n - \"序部署应用\""

Change History

Changed 3 years ago by More readable version...

This bug makes it so that a file cannot be yamlized, transferred to another machine, and un-yamlized. (for example, from a 64-bit server machine to a 32-bit dev machine)

It says object expected, but got a string.

To reproduce: for 1.8.4

a = {}

=> {}

a[:tags] = ['序部署应用', '序部署应用']

=> ["序部署应用", "序部署应用"]

a.to_yaml

=> "--- \n:tags: \n- !binary |\n 5bqP6YOo572y5bqU55So\n\n- !binary |\n 5bqP6YOo572y5bqU55So\n\n"

b = a[:tags]

=> ["序部署应用", "序部署应用"]

b.to_yaml

=> "--- \n- !binary |\n 5bqP6YOo572y5bqU55So\n\n- !binary |\n 5bqP6YOo572y5bqU55So\n\n"

b[0].to_yaml

=> "--- !binary |\n5bqP6YOo572y5bqU55So\n\n"

for 1.8.2: (more portable way)

a = {}

a = {}

=> {}

a[:tags] = ['序部署应用', '序部署应用']

=> ["序部署应用", "序部署应用"]

a.to_yaml

=> "--- \n:tags: \n - \"序部署应用\"\n - \"序部署应用\""

Note: See TracTickets for help on using tickets.