From 3c061dc852add8f9b86006e9265d6ecbb7c0753a Mon Sep 17 00:00:00 2001 From: Liam Whalen Date: Fri, 16 Sep 2011 08:52:08 -0400 Subject: [PATCH] Modified spine_labels.js to retain UTF-8 encoding Dan Wells posted a fix to the DEV list for receipt printing that allowed the receipt printer to print UTF-8 characters. I used the ideas in that fix to modify spine_labels.js. In spine_labels.js, the url passed to the preview in preview_xul_192 was encoding the url with the javascript encode() function. This function does not preserve UTF-8 encodings. I changed the function to encodeURIComponent, and UTF-8 characters are now displayed properly by the spine label printer code. Signed-off-by: Liam Whalen Signed-off-by: Dan Scott --- Open-ILS/xul/staff_client/server/cat/spine_labels.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Open-ILS/xul/staff_client/server/cat/spine_labels.js b/Open-ILS/xul/staff_client/server/cat/spine_labels.js index ce28eacb45..c952bc9ee5 100644 --- a/Open-ILS/xul/staff_client/server/cat/spine_labels.js +++ b/Open-ILS/xul/staff_client/server/cat/spine_labels.js @@ -625,7 +625,7 @@ 'tab_name' : $("catStrings").getString('staff.cat.spine_labels.preview.title') }, { - 'url' : 'data:text/html;charset=utf-8,'+window.escape(html), + 'url' : 'data:text/html;charset=utf-8,' + encodeURIComponent(html), 'html_source' : html, 'show_print_button' : 1, 'printer_context' : 'label', -- 2.43.2