Bugzilla – Attachment 3950 Details for
Bug 2246
Label printing doesn't work with Unicode characters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Partial fix to reduce invalid pdf generation due to wide character errors.
0001-Bug-2246-Partial-Label-printing-doesn-t-work-with-Un.patch (text/plain), 1.74 KB, created by
Chris Nighswonger
on 2011-04-19 13:17:20 UTC
(
hide
)
Description:
Partial fix to reduce invalid pdf generation due to wide character errors.
Filename:
MIME Type:
Creator:
Chris Nighswonger
Created:
2011-04-19 13:17:20 UTC
Size:
1.74 KB
patch
obsolete
>From 93cae07bda7684900a5312c6a1f95dd821a93805 Mon Sep 17 00:00:00 2001 >From: Chris Nighswonger <cnighswonger@foundations.edu> >Date: Tue, 19 Apr 2011 09:07:49 -0400 >Subject: [PATCH] Bug 2246 - (Partial) Label printing doesn't work with Unicode characters >Content-Type: text/plain; charset="utf-8" > >This patch provides a very partial fix for this bug in that it reduces >the number of pdf generation failures due to a "wide character" error. >It does not ensure that all unicode characters will print correctly as >this is dependent upon many other issues mentioned in this bug and >various posts to the developer list. > >What this code does is test to see if the pdf stream is utf8 encoded >and if it is, explicitly declares it to be so. Unicode chars will still >print incorrectly, but the pdf will be created and should open properly >in whatever pdf reader. > >You may test this by adding any character with a diacritical to the >title of a bib and then attempting to generate a label pdf with the >title of that bib. Before the patch is applied the resulting pdf >should contain an error mentioning a wide character issue. After the >patch is applied, the pdf should be valid. > >No documentation changes are necessary as a result of this patch. > >This patch should be backported to 3.2.x. >--- > C4/Creators/PDF.pm | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > >diff --git a/C4/Creators/PDF.pm b/C4/Creators/PDF.pm >index d181bdb..0aae09c 100644 >--- a/C4/Creators/PDF.pm >+++ b/C4/Creators/PDF.pm >@@ -49,6 +49,8 @@ sub new { > > sub End { > my $self = shift; >+ # if the pdf stream is utf8, explicitly set it to utf8; this avoids at lease some wide character errors -chris_n >+ utf8::encode($PDF::Reuse::stream) if utf8::is_utf8($PDF::Reuse::stream); > prEnd(); > } > >-- >1.7.0.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 2246
:
585
|
586
|
3950
|
4291
|
4292
|
4293
|
5713