Skip to content

Commit

Permalink
regcharclass.pl: Add ability to avoid wrong mnemonic
Browse files Browse the repository at this point in the history
A future commit will pass this function data that shouldn't be
translated into a mnemonic, like 'f' for the letter f.  The reason is
that that code will potentially be executed on a machine with a
different character set than what the mnemonic would be valid for.
  • Loading branch information
khwilliamson committed Aug 7, 2021
1 parent bb20f3e commit 0dc7c81
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion regcharclass.h
Expand Up @@ -3765,6 +3765,6 @@
* 696e706fddd3ce8cd48c7ea91caf4c9edf5c296432d320aa7b78631f69aa9eac lib/unicore/mktables
* 50b85a67451145545a65cea370dab8d3444fbfe07e9c34cef560c5b7da9d3eef lib/unicore/version
* 0a6b5ab33bb1026531f816efe81aea1a8ffcd34a27cbea37dd6a70a63d73c844 regen/charset_translations.pl
* 02415e05b0af39e3fb07a1ec2050ab35787e28b258d926074b95f196dd922946 regen/regcharclass.pl
* b4f1b6922eae1fbac74236d06906225702f8f42b315809b1d9e2c613ab4ceb24 regen/regcharclass.pl
* b2f896452d2b30da3e04800f478c60c1fd0b03d6b668689b020f1e3cf1f1cdd9 regen/regcharclass_multi_char_folds.pl
* ex: set ro: */
3 changes: 2 additions & 1 deletion regen/regcharclass.pl
Expand Up @@ -309,6 +309,7 @@ sub val_fmt
{
my $self = shift;
my $arg = shift;
my $always_hex = shift // 0; # Use \x{}; don't look for a mnemonic

# Format 'arg' using the printable character if it has one, or a %x if
# not, returning a string containing the result
Expand All @@ -317,7 +318,7 @@ sub val_fmt
return $hex_fmt unless defined $arg && $arg !~ /\D/;

# We convert only things inside Latin1
if ($arg < 256) {
if (! $always_hex && $arg < 256) {

# Find the ASCII equivalent of this argument (as the current character
# set might not be ASCII)
Expand Down

0 comments on commit 0dc7c81

Please sign in to comment.