Index: Graphics.pm =================================================================== --- Graphics.pm (revision 7230) +++ Graphics.pm (working copy) @@ -221,8 +221,16 @@ } # if we've got non latin characters, make sure the hebrew is in the right order for printing if ($canUseBiDi) { - $string = Locale::Hebrew::hebrewflip($string); - @ords = (); + # Bug 3327 - only call hebrewflip if the string contains hebrew characters + # The ranges 0590 - 05FF and FB00 - FB4F are for Hebrew and Hebrew Presentation forms + # as detailed at http://www.unicode.org/charts/ + foreach my $ord (@ords) { + if ($ord >= 0x0590 && $ord <= 0x05FF || $ord >= 0xFB00 && $ord <= 0xFB4F) { + $string = Locale::Hebrew::hebrewflip($string); + @ords = (); + last; + } + } } @ords = unpack($unpackTemplate, $string) unless @ords;