Skip Menu |

This queue is for tickets about the String-Random CPAN distribution.

Report information
The Basics
Id: 47663
Status: resolved
Priority: 0/
Queue: String-Random

People
Owner: Nobody in particular
Requestors: martin.von.wittich [...] iserv.eu
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.198
Fixed in: (no value)



Subject: Umlauts
German umlauts don't work: #!/usr/bin/perl use strict; use warnings; use String::Random qw(random_regex); print random_regex "ü[ü]"; prints "ü�" instead of "üü". Debian etch perl: This is perl, v5.8.8 built for i486-linux-gnu-thread-multi libstring-random-perl: 0.198-4 uname -a: Linux iserv.dev2.iserv.eu 2.6.26-1-xen-amd64 #1 SMP Fri Mar 13 21:39:38 UTC 2009 x86_64 GNU/Linux Perl script encoding: utf8, written in vim.
On Tue Jul 07 15:09:53 2009, MartinVW wrote: Show quoted text
> German umlauts don't work: > > #!/usr/bin/perl > use strict; > use warnings; > use String::Random qw(random_regex); > print random_regex "ü[ü]"; > > prints "ü�" instead of "üü". > > Debian etch > perl: This is perl, v5.8.8 built for i486-linux-gnu-thread-multi > libstring-random-perl: 0.198-4 > uname -a: Linux iserv.dev2.iserv.eu 2.6.26-1-xen-amd64 #1 SMP Fri Mar 13 > 21:39:38 UTC 2009 x86_64 GNU/Linux > Perl script encoding: utf8, written in vim.
The bug is all yours. You encoded the file using UTF-8, but you didn't tell Perl it was UTF-8 using use utf8; Then you print out text without telling Perl how to encode it for your terminal using use open ':std', ':encoding(UTF-8)'; This is not a bug (in String::Random).
On Fri Jul 12 14:03:41 2013, ikegami wrote: Show quoted text
> On Tue Jul 07 15:09:53 2009, MartinVW wrote:
> > German umlauts don't work: > > > > #!/usr/bin/perl > > use strict; > > use warnings; > > use String::Random qw(random_regex); > > print random_regex "ü[ü]"; > > > > prints "ü�" instead of "üü". > > > > Debian etch > > perl: This is perl, v5.8.8 built for i486-linux-gnu-thread-multi > > libstring-random-perl: 0.198-4 > > uname -a: Linux iserv.dev2.iserv.eu 2.6.26-1-xen-amd64 #1 SMP Fri Mar > > 13 > > 21:39:38 UTC 2009 x86_64 GNU/Linux > > Perl script encoding: utf8, written in vim.
> > The bug is all yours. You encoded the file using UTF-8, but you didn't > tell Perl it was UTF-8 using > > use utf8; > > Then you print out text without telling Perl how to encode it for your > terminal using > > use open ':std', ':encoding(UTF-8)'; > > This is not a bug (in String::Random).
Resolving per the comment. Thanks for the analysis. Regards, -- Shlomi Fish