Skip to content

Commit

Permalink
Override some chars marked as control in unicode tables but are
Browse files Browse the repository at this point in the history
expected to be found in normal text files.
  • Loading branch information
gwsw committed Jul 25, 2017
1 parent b4f5fe1 commit 18e0088
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion compose.uni
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Generated by "./mkutable -f2 Mn Me Cf -- unicode/UnicodeData.txt" on Mon Jun 26 10:40:58 PDT 2017 */
/* Generated by "./mkutable -f2 Mn Me Cf -- unicode/UnicodeData.txt" on Tue Jul 25 09:04:35 PDT 2017 */
{ 0x00ad, 0x00ad }, /* Cf */
{ 0x0300, 0x036f }, /* Mn */
{ 0x0483, 0x0487 }, /* Mn */
Expand Down
11 changes: 11 additions & 0 deletions mkutable
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ use vars qw( $opt_f $opt_n );
use Getopt::Std;
my $type_field = 2;

# Override Unicode tables for certain control chars
# that are expected to be found in normal text files.
my %force_space = (
0x08 => 1, # backspace
0x09 => 1, # tab
0x0a => 1, # newline
0x0c => 1, # form feed
0x0d => 1, # carriage return
);

exit (main() ? 0 : 1);

sub main {
Expand Down Expand Up @@ -47,6 +57,7 @@ sub main {
my $type = $fields[$type_field];
$type =~ s/\s//g;
for ($last_code = $lo_code; $last_code <= $hi_code; ++$last_code) {
$type = 'Zs' if $force_space{$last_code};
output(\%out, $last_code, $type);
}
}
Expand Down
6 changes: 4 additions & 2 deletions ubin.uni
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* Generated by "./mkutable -f2 Cc Cs Co Zl Zp -- unicode/UnicodeData.txt" on Mon Jun 26 10:40:58 PDT 2017 */
{ 0x0000, 0x001f }, /* Cc */
/* Generated by "./mkutable -f2 Cc Cs Co Zl Zp -- unicode/UnicodeData.txt" on Tue Jul 25 09:04:35 PDT 2017 */
{ 0x0000, 0x0007 }, /* Cc */
{ 0x000b, 0x000b }, /* Cc */
{ 0x000e, 0x001f }, /* Cc */
{ 0x007f, 0x009f }, /* Cc */
{ 0x2028, 0x2028 }, /* Zl */
{ 0x2029, 0x2029 }, /* Zp */
Expand Down
2 changes: 1 addition & 1 deletion wide.uni
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Generated by "./mkutable -f1 W F -- unicode/EastAsianWidth.txt" on Mon Jun 26 10:40:58 PDT 2017 */
/* Generated by "./mkutable -f1 W F -- unicode/EastAsianWidth.txt" on Tue Jul 25 09:04:35 PDT 2017 */
{ 0x1100, 0x115f }, /* W */
{ 0x231a, 0x231b }, /* W */
{ 0x2329, 0x232a }, /* W */
Expand Down

0 comments on commit 18e0088

Please sign in to comment.