]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/bugs/yaml_setup_file_does_not_support_UTF-8_if_XS_is_installed.mdwn
Support YAML::XS by not passing decoded unicode to Load. Closes: #625713
[ikiwiki.git] / doc / bugs / yaml_setup_file_does_not_support_UTF-8_if_XS_is_installed.mdwn
index 70ba4b582c31c0cc1e760a72dce36136d30f1881..f5e86f65f64e217c5298c2a678348ff17ca13e15 100644 (file)
@@ -75,3 +75,28 @@ preferred one?
 >>>>>> YAML::Any's fault, or Perl's fault, or... the way ikiwiki
 >>>>>> slurps and untaints UTF-8 YAML setup files. Sorry for providing
 >>>>>> information that may have been misguided. --[[intrigeri]]
+
+>>>>>>> `use utf8` is completely irrelevant; that only tells
+>>>>>>> perl to support utf8 in its source code.
+>>>>>>>
+>>>>>>> I don't know what `Path::Class::File` is, but if it
+>>>>>>> provides non-decoded bytes to the module than it would likely
+>>>>>>> avoid this failure, while resulting in parsed yaml where every
+>>>>>>> string was likewise not decoded unicode, which is not very useful.
+>>>>>>> --[[Joey]]
+
+>>>>>>>> You guessed right about the non-decoded bytes being passed to
+>>>>>>>> YAML::XS, except this is the way it shall be done. YAML::XS
+>>>>>>>> POD reads: "YAML::XS only deals with streams of utf8 octets".
+>>>>>>>> Feed it with non-decoded UTF-8 bytes and it gives you
+>>>>>>>> properly encoded UTF-8 Perl strings in exchange.
+>>>>>>>>
+>>>>>>>> Once this has been made clear, since 1. this module indeed
+>>>>>>>> seems to be the future of YAML in Perl, and 2. is depended on
+>>>>>>>> by other popular software such as dh-make-perl (on the 2nd
+>>>>>>>> degree), I suggest using it explicitly instead of the current
+>>>>>>>> "try to support every single YAML Perl module and end up
+>>>>>>>> conflicting with the now recommended one" nightmare.
+>>>>>>>> --[[intrigeri]]
+
+>>>>>>>>> Ok, [[done]] (although YAML::Syck does also still work.) --[[Joey]]