Thread Zu perlfaq: "How can I make \w match national character sets?" (10 answers)
Opened by Gast at 2009-10-17 18:05

Gast Gast
 2009-10-17 20:15
#127051 #127051
Ohne "use locale" funktioniert es jetzt bei mir auch. Wobei noch eine kleine Restunzufriedenheit bleibt, weil es mit locale nicht funktioniert.

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/perl
use 5.010;
use strict;
use warnings;
use utf8;
use Encode qw( encode );


my $string = 'abcäöüß';

my @match = $string =~ /(\w)/g;

say encode( 'utf-8', "@match" ); # a b c ä ö ü ß

View full thread Zu perlfaq: "How can I make \w match national character sets?"