Skip to content

Commit

Permalink
--separator=Ф is working as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
bessarabov committed Nov 12, 2023
1 parent 3de0e87 commit a18c7d1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/data/separator_unicode/cmd_and_expected_output
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$ cat $TEST_DIR/separator_unicode.tsv | $TSV2TABLE --separator=Ф
1 | 2
a | b | c
2 changes: 2 additions & 0 deletions tests/data/separator_unicode/separator_unicode.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1Ф2
aФbФc
6 changes: 6 additions & 0 deletions tsv2table
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,19 @@ use feature qw(say);
use utf8;
use open qw(:std :utf8);

use Encode qw(decode);
use Getopt::Long;
use I18N::Langinfo qw(CODESET langinfo);

sub parse_options {

my $header;
my $separator;
my $help;

my $codeset = langinfo(CODESET);
@ARGV = map { decode $codeset, $_ } @ARGV;

GetOptions (
'header=s' => \$header,
'separator=s' => \$separator,
Expand Down Expand Up @@ -81,6 +86,7 @@ https://github.com/bessarabov/tsv2table
separator => $separator,
};

return $options;
}

# my ($type, $non_fractional_length, $fractional_length) = get_type('13.123'); # ('float', 2, 4)
Expand Down

0 comments on commit a18c7d1

Please sign in to comment.