Patch is attached. Not the prettiest, but I'm fairly sure it will be
robust against encoding changes.
diff --git a/t/grove.t b/t/grove.t
index a1ab816..8632764 100644
--- a/t/grove.t
+++ b/t/grove.t
@@ -106,9 +106,10 @@ print "ok 2\n";
# TEST: as_cannon_xml
$expected = <<'EOF';
-<bible> <testament><title>The Old Testament</title> ... <book id="OneKings"> <title>The First Book of the Kings</title> <subtitle>Commonly called The Third Book of the Kings</subtitle> ... <chapter num="19"> <narrative>Jezebel threatens Elijah</narrative> <verse dotted="true" num="1">And ÄʹhÄb told JÄzʹe-bÄl all that EË-līʹjah had done, and withal how he had slain all the prophets with the sword. <xref c="18" v="40"></xref></verse> <verse dotted="true" num="2">Then JÄzʹe-bÄl sent a messenger unto EË-līʹjah, saying, So let the gods do <i>to me</i>, and more also, if I make not thy life as the life of one of them by to morrow about this time. <xref b="Ru" c="1" v="17"></xref> <xref c="2" v="23"></xref> <xref c="27" n="Pr" v="1"></xref> </verse> <verse dotted="false" num="3">And when he saw <i>that</i>, he arose, and went for his life, and came to BÄʹer-shÄʹbaÌ, which <i>belongeth</i> to Jūʹdah, and left his servant there.</verse> <verse dotted="true" num="4">¶ But he himself went a day's journey into the wilderness, and came and sat down under a juniper tree: and he requested for himself that he might die; and said, It is enough; now, O L<smallcaps>ORD</smallcaps>, take away my life; for I <i>am</i> not better than my fathers. <xref b="Nu" c="11" v="15"></xref> <xref b="Jon" c="4" v="3,8"></xref> <xref b="Ph" c="1" v="21-24"></xref> <footnote>for himself, or for his life</footnote> </verse> <narrative>An angel ministers to him</narrative> <verse dotted="true" num="5">And as he lay and slept under a juniper tree, behold, then an angel touched him, and said unto him, Arise <i>and</i> eat. <xref b="Ps" c="34" v="7"></xref> <xref b="Ac" c="12" v="7"></xref> <xref b="Heb" c="1" v="14"></xref> </verse> ... </chapter> ... </book> ... </testament> ... </bible>
+<bible> <testament><title>The Old Testament</title> ... <book id="OneKings"> <title>The First Book of the Kings</title> <subtitle>Commonly called The Third Book of the Kings</subtitle> ... <chapter num="19"> <narrative>Jezebel threatens Elijah</narrative> <verse dotted="true" num="1">And --100----2b9--h--103--b told J--115--z--2b9--e-b--115--l all that E--2d4---l--12b----2b9--jah had done, and withal how he had slain all the prophets with the sword. <xref c="18" v="40"></xref></verse> <verse dotted="true" num="2">Then J--115--z--2b9--e-b--115--l sent a messenger unto E--2d4---l--12b----2b9--jah, saying, So let the gods do <i>to me</i>, and more also, if I make not thy life as the life of one of them by to morrow about this time. <xref b="Ru" c="1" v="17"></xref> <xref c="2" v="23"></xref> <xref c="27" n="Pr" v="1"></xref> </verse> <verse dotted="false" num="3">And when he saw <i>that</i>, he arose, and went for his life, and came to B--113----2b9--er-sh--113----2b9--ba--307--, which <i>belongeth</i> to J--16b----2b9--dah, and left his servant there.</verse> <verse dotted="true" num="4">--b6-- But he himself went a day's journey into the wilderness, and came and sat down under a juniper tree: and he requested for himself that he might die; and said, It is enough; now, O L<smallcaps>ORD</smallcaps>, take away my life; for I <i>am</i> not better than my fathers. <xref b="Nu" c="11" v="15"></xref> <xref b="Jon" c="4" v="3,8"></xref> <xref b="Ph" c="1" v="21-24"></xref> <footnote>for himself, or for his life</footnote> </verse> <narrative>An angel ministers to him</narrative> <verse dotted="true" num="5">And as he lay and slept under a juniper tree, behold, then an angel touched him, and said unto him, Arise <i>and</i> eat. <xref b="Ps" c="34" v="7"></xref> <xref b="Ac" c="12" v="7"></xref> <xref b="Heb" c="1" v="14"></xref> </verse> ... </chapter> ... </book> ... </testament> ... </bible>
EOF
chop ($expected);
+$expected =~ s/--([0-9a-fA-F]+)--/chr(hex($1))/ge;
$got = $g->as_canon_xml;
print (($got eq $expected) ? "ok 3\n" : "not ok 3\n");
@@ -124,11 +125,11 @@ Commonly called The Third Book of the Kings
...
Jezebel threatens Elijah
-And ÄʹhÄb told JÄzʹe-bÄl
-all that EË-līʹjah had done, and withal how he had slain all the prophets with
+And --100----2b9--h--103--b told J--115--z--2b9--e-b--115--l
+all that E--2d4---l--12b----2b9--jah had done, and withal how he had slain all the prophets with
the sword.
-Then JÄzʹe-bÄl sent a messenger unto EË-līʹjah,
+Then J--115--z--2b9--e-b--115--l sent a messenger unto E--2d4---l--12b----2b9--jah,
saying, So let the gods do to me, and more also, if I make not thy life
as the life of one of them by to morrow about this time.
@@ -136,9 +137,9 @@ as the life of one of them by to morrow about this time.
And when he saw that, he arose, and went
-for his life, and came to BÄʹer-shÄʹbaÌ, which belongeth to
-Jūʹdah, and left his servant there.
-¶ But he himself went a day's journey
+for his life, and came to B--113----2b9--er-sh--113----2b9--ba--307--, which belongeth to
+J--16b----2b9--dah, and left his servant there.
+--b6-- But he himself went a day's journey
into the wilderness, and came and sat down under a juniper tree: and he
requested for himself that he might die; and said, It is enough; now, O LORD,
take away my life; for I am not better than my fathers.
@@ -163,6 +164,7 @@ behold, then an angel touched him, and said unto him, Arise and eat.
...
EOF
+$expected =~ s/--([0-9a-fA-F]+)--/chr(hex($1))/ge;
$got = $g->as_string;
print (($got eq $expected) ? "ok 4\n" : "not ok 4\n");