Hello,
I have issues parsing an UTF-8-YAML string using yaml_read. Do I miss something or is it a bug?
I use Ubuntu and currently have this libyaml version installed:
libyaml-0-2/noble,now 0.2.5-1build1 amd64 [Installiert,automatisch]
Kind regards,
Wolfram.
$ swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 9.0.4)
%...
[trace] ?- yaml_read(string("name: Kovacs"),Yaml).
Call: (10) yaml:yaml_read(string("name: Kovacs"), _1326) ? up
Yaml = yaml{name:"Kovacs"}.
[trace] ?- yaml_read(string("name: Kovács"),Yaml).
Call: (10) yaml:yaml_read(string("name: Kovács"), _4448) ? up
ERROR: Unknown error term: yaml_error(2,"invalid trailing UTF-8 octet")
ERROR: In:
ERROR: [13] yaml:yaml_parse_stream(<stream>(0x61fe3cd67c60),_6630)
ERROR: [12] setup_call_catcher_cleanup(yaml:yaml_open(...,<stream>(0x61fe3cd67c60),...),yaml:yaml_parse_stream(<stream>(0x61fe3cd67c60),_6686),_6658,yaml:close(<stream>(0x61fe3cd67c60))) at /usr/lib/swi-prolog/boot/init.pl:679
ERROR: [11] setup_call_cleanup(yaml:yaml_open(...,<stream>(0x61fe3cd67c60),...),yaml:yaml_parse_stream(<stream>(0x61fe3cd67c60),_6750),yaml:close(<stream>(0x61fe3cd67c60))) at /usr/lib/swi-prolog/boot/init.pl:682
ERROR: [10] yaml:yaml_read(string("name: Kovács"),_6792) at /usr/lib/swi-prolog/library/yaml.pl:96
ERROR: [9] toplevel_call(user:user: ...) at /usr/lib/swi-prolog/boot/toplevel.pl:1173
Exception: (13) yaml:yaml_parse_stream(<stream>(0x61fe3cd67c60), _5824) ? abort
% Execution Aborted
$ echo "Kovács" | hexdump -C
00000000 4b 6f 76 c3 a1 63 73 0a |Kov..cs.|