Changeset 36409 in osm


Ignore:
Timestamp:
2025-03-20T16:44:40+01:00 (2 days ago)
Author:
stoecker
Message:

support utf-8

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/i18n/replacetrans.pl

    r36400 r36409  
    44use strict;
    55use open qw/:std :encoding(utf8)/;
     6use Encode;
    67
    78# call with pairs of strings, first the wrong string, second the replacement
     
    1112while(@ARGV)
    1213{
    13   my $from = shift @ARGV;
    14   my $to = shift @ARGV;
     14  my $from = Encode::decode("utf-8", shift @ARGV);
     15  my $to = Encode::decode("utf-8", shift @ARGV);
    1516  $rep{$from} = $to;
    1617  print "'$from' -> '$to'\n";
    1718}
    1819
    19 for my $po (reverse sort glob("po/*.po"))
     20for my $po (reverse sort glob("po/fr.po"))
    2021{
    2122  local $/;
    2223  $/ = "\n\n";
    23   open my $in,'<',$po or die;
     24  open my $in,'<:encoding(utf-8)',$po or die;
    2425  my $outpo = $po;
    2526  $outpo =~ s/.*\///;
    2627  open my $out,'>',$outpo or die;
    2728  my $changed = 0;
    28  
     29
    2930  for my $line (<$in>)
    3031  {
Note: See TracChangeset for help on using the changeset viewer.