Skip Menu |

This queue is for tickets about the JSON CPAN distribution.

Report information
The Basics
Id: 87809
Status: rejected
Priority: 0/
Queue: JSON

People
Owner: Nobody in particular
Requestors: victor [...] vsespb.ru
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: (no value)
Fixed in: (no value)



Subject: docs adjustment related to unicode
Problem with the following paragraph: Show quoted text
> The latter cannot store everything but uses less space in general (and > some buggy Perl or C code might even rely on that internal representation being used).
Internal representation of Latin-1 strings is important when we deal with filenames. Below is an example (prints "file not found No such file or directory at"), when downgraded string is same as upgraded, but points to different files. So, I think 99% of code which opens file, without trying to convert filename into bytes, and will be affected by string downgrades. use strict; use warnings; use utf8; my ($u, undef) = split / / , "\x{b5} \x{442}\x{435}\x{441}\x{442}"; my $d = $u; utf8::downgrade($u); die unless $u eq $d; open my $f, ">", "$u.tmp"; print $f "TEST"; close $f; open $f, "<", "$d.tmp" or die "file not found $!";
On Tue Aug 13 19:56:55 2013, vsespb wrote: Show quoted text
> Problem with the following paragraph: >
> > The latter cannot store everything but uses less space in general > > (and > > some buggy Perl or C code might even rely on that internal > > representation being used).
> > Internal representation of Latin-1 strings is important when we deal > with filenames. > > Below is an example (prints "file not found No such file or directory > at"), when > downgraded string is same as upgraded, but points to different files. > > So, I think 99% of code which opens file, without trying to convert > filename into bytes, and > will be affected by string downgrades. > > > > use strict; > use warnings; > use utf8; > > my ($u, undef) = split / / , "\x{b5} \x{442}\x{435}\x{441}\x{442}"; > my $d = $u; > utf8::downgrade($u); > die unless $u eq $d; > > open my $f, ">", "$u.tmp"; > print $f "TEST"; > close $f; > > open $f, "<", "$d.tmp" or die "file not found $!";
This is irrelevant to JSON. Thanks.