Commit 5d1365fc authored by Jonas Smedegaard's avatar Jonas Smedegaard

Use utf8 features of Path::Tiny (not Encode).

parent 2ca8c658
......@@ -18,7 +18,6 @@ use strict;
use warnings;
use autodie;
use Encode;
use Carp::Always; #
# stronger than $Carp::Verbose = 1;
use RDF::Trine;
......@@ -102,10 +101,10 @@ my $infile = path($ARGV[0]);
my $outfile = path( $infile->basename('.ttl') . '.puml' );
my $prefixfile = path('prefixes.ttl');
my $prefixes = $prefixfile->exists ? $prefixfile->slurp : "";
my $data = $infile->slurp;
my $turtle = decode_utf8 "$PREFIXES_TURTLE\n$prefixes\n$data";
my $prefixes_all = decode_utf8 "$PREFIXES_TURTLE\n$prefixes";
my $prefixes = $prefixfile->exists ? $prefixfile->slurp_utf8 : "";
my $data = $infile->slurp_utf8;
my $turtle = "$PREFIXES_TURTLE\n$prefixes\n$data";
my $prefixes_all = "$PREFIXES_TURTLE\n$prefixes";
open (STDOUT, ">:encoding(UTF-8)", $outfile);
binmode STDERR, ":encoding(UTF-8)";
#print STDERR $turtle; die;
  • ok! is there something similar for output? See the stupid myprint() sub

  • Yes, but that requires a larger refactoring of your code: You currently spew fractions of the output at many places in the code, and redirect only one place to redirect all output to a file.

    I don't want to try refactor now - I believe it makes better sense to do that as part of an even larger refactoring to move functionality into one or more libraries.

  • print does "redirect to file", the reason I have myprint() is because I had some unicode trouble. Ok, adding to TODO

Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment