Restore decomposed support in entityize() collab/dbwells/encode-changed-behaviour
authorDan Wells <dbw2@calvin.edu>
Wed, 23 Oct 2013 16:03:29 +0000 (12:03 -0400)
committerDan Wells <dbw2@calvin.edu>
Wed, 23 Oct 2013 16:03:29 +0000 (12:03 -0400)
Now that we have updated our test check, let's restore the missing
code bits to pass the test.

Signed-off-by: Dan Wells <dbw2@calvin.edu>
Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm

index be6fd2a..b5900ed 100644 (file)
@@ -1513,9 +1513,11 @@ sub entityize {
     my($self, $string, $form) = @_;
     $form ||= "";
 
-    # If we're going to convert non-ASCII characters to XML entities,
-    # we had better be dealing with a UTF8 string to begin with
-       $string = NFC($string);
+    if ($form eq 'D') {
+        $string = NFD($string);
+    } else {
+        $string = NFC($string);
+    }
 
     # Convert raw ampersands to entities
     $string =~ s/&(?!\S+;)/&amp;/gso;