[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/Convert/Unicode.pm (check_unicode_po
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/Convert/Unicode.pm (check_unicode_point_conversion): with strict encoding, there is a warning for nonchar with perl 5.10.1 on solaris 11, though not on solaris 10. So for a range of perl versions, 5.10.0 to 5.13.8 we do not attempt the eval and check for the codepoints to be below 0x10FFFF early. |
Date: |
Sat, 29 Jul 2023 03:51:51 -0400 |
This is an automated email from the git hooks/post-receive script.
pertusus pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new 30316397b4 * tp/Texinfo/Convert/Unicode.pm
(check_unicode_point_conversion): with strict encoding, there is a warning for
nonchar with perl 5.10.1 on solaris 11, though not on solaris 10. So for a
range of perl versions, 5.10.0 to 5.13.8 we do not attempt the eval and check
for the codepoints to be below 0x10FFFF early.
30316397b4 is described below
commit 30316397b48707ad83b19a583dbc7ecbb94b164d
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Jul 29 09:51:35 2023 +0200
* tp/Texinfo/Convert/Unicode.pm (check_unicode_point_conversion): with
strict encoding, there is a warning for nonchar with perl 5.10.1 on
solaris 11, though not on solaris 10. So for a range of perl versions,
5.10.0 to 5.13.8 we do not attempt the eval and check for the
codepoints to be below 0x10FFFF early.
---
ChangeLog | 8 ++++++++
tp/Texinfo/Convert/Unicode.pm | 26 +++++++++++++++++++++++++-
2 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 6ab14bb02b..26715d421c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2023-07-29 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Convert/Unicode.pm (check_unicode_point_conversion): with
+ strict encoding, there is a warning for nonchar with perl 5.10.1 on
+ solaris 11, though not on solaris 10. So for a range of perl versions,
+ 5.10.0 to 5.13.8 we do not attempt the eval and check for the
+ codepoints to be below 0x10FFFF early.
+
2023-07-28 Gavin Smith <gavinsmith0123@gmail.com>
* doc/texinfo.tex (\deftypeline): Read arguments correctly, in
diff --git a/tp/Texinfo/Convert/Unicode.pm b/tp/Texinfo/Convert/Unicode.pm
index f3cd447664..83812ca79e 100644
--- a/tp/Texinfo/Convert/Unicode.pm
+++ b/tp/Texinfo/Convert/Unicode.pm
@@ -1597,8 +1597,32 @@ sub check_unicode_point_conversion($;$)
# The warning about non-characters is only given when the code
# point is attempted to be output, not just manipulated.
#
http://stackoverflow.com/questions/5127725/how-could-i-catch-an-unicode-non-character-warning
+ # In perl 5.36.0, Encoding and printing also do not give a warning, so
+ # no warning for:
#
- # Therefore, we have to try to output it within an eval.
+ # my ($fh, $string);
+ # open($fh, ">", \$string);
+ # my $char = chr(hex("110000"));
+ # print $fh Encode::encode("utf-8", $char);
+ #
+ # but there is a warning if going through an encoding layer as below.
+ #
+ # In perl 5.10.1 on solaris 11, but not on solaris 10, the warning all does
+ # not catch the nonchar warning (this warning seems to be defined on
+ # 5.13.10 or newer). This may be a consequence of what is described in
+ #
http://stackoverflow.com/questions/5127725/how-could-i-catch-an-unicode-non-character-warning
+ # as a compiler bug, but it is unclear. This does not happen with the
+ # lax conversion to utf8, but we prefer to use a strict conversion.
+ #
+ # To avoid outputting a warning, we do not even try the eval for perls
+ # in the 5.10.0 5.13.8 range
+ if ($] >= 5.010 and $] <= 5.013008) {
+ if (hex($arg) > 0x10FFFF) {
+ return 0;
+ }
+ }
+ #
+ # For the other cases, we have to try to output it within an eval.
# Since opening /dev/null or a temporary file means
# more system-dependent checks, use a string as our
# filehandle.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/Convert/Unicode.pm (check_unicode_point_conversion): with strict encoding, there is a warning for nonchar with perl 5.10.1 on solaris 11, though not on solaris 10. So for a range of perl versions, 5.10.0 to 5.13.8 we do not attempt the eval and check for the codepoints to be below 0x10FFFF early.,
Patrice Dumas <=