Skip Menu |
 

This queue is for tickets about the Encode CPAN distribution.

Report information
The Basics
Id: 84992
Status: resolved
Priority: 0/
Queue: Encode

People
Owner: Nobody in particular
Requestors: h.m.brand [...] xs4all.nl
Cc:
AdminCc:

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



From h.m.brand [...] xs4all.nl Thu May 2 05: 26:47 2013
MIME-Version: 1.0
X-Spam-Status: No, score=-6.488 tagged_above=-99.9 required=10 tests=[AWL=0.412, BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5] autolearn=ham
X-Mailer: Claws Mail 3.9.0-196-ge98c82 (GTK+ 2.24.10; x86_64-suse-linux-gnu)
X-Spam-Flag: NO
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwEAIAAACI8LKTAAAACXBIWXMAAABIAAAASABGyWs+AAAC JElEQVRo3u2aMY4CMQxFczZ6RItEzRm4DBINDbRUSPRInIRbsNK6+dJfezN4kokn48IaCSjysL8d e9Knoj2fr9f9/gllqQ6U9/vxWK3EdwdIEGjRIVCu18NhuxUfK46SH81+fzrdbuKPx/P5ctHQdAdI TKAgpvV6s9ntBEfXEYSGgMQzIHnuFBBjkshCNJ2KtJZ04hHNAugP8bZr3NIHhbcF0AKoK0CoaHXU LUWBIs1n+jV+Fl8CVqOApEXAwyMO/DSR4XVntoAYDR7eBjQupuYAYTMph8Rj21D4m7MChN02tpqs NSnb/KqU2oHCXu5xDCgflj/RAgBiKBIXnICzAsSjWBsTz5K4/HeXYvb8yK5lY3VGEwPi2aONKT+5 AlcxrTPOwcTiraGRChgMEKJh0bVVifGVTq6qgBiNVl8QE29EsK6VE+YJAOG2wz5AvsqUS6uqgHCA n4NGvBYpnJ64Jgg27sCtxtBk1CJIA4S/GhdWKh07QxUB48jWGhZ4jKamRRr/T8/M0AaEyctry6YB 4dTGj9iWZNs3DahES5kPCJOu0RQbF/fQOBprsB9gaO9JtPDzII9U5ySXX7AnuIt91y54AAW7rPpT LCe5gt3F+CLqr2UarGB3MXvMylWGq4+9RCx3TW1oJq1t3HPQlFs6N1fFNEB4s8dn7Ne7ACSm7TPQ I5quAWmw6qBpulHM33B0Csge4Nd8JTTYG2b1XyRe3lH8x34ABJ6aePuQ2N4AAAAASUVORK5CYII=
content-type: text/plain; charset="utf-8"
Message-ID: <20130502112630.15166ea1 [...] pc09.procura.nl>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Virus-Scanned: by XS4ALL Virus Scanner
X-Spam-Score: -6.488
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id E1522240CAF for <cpan-bug+Encode [...] hipster.bestpractical.com>; Thu, 2 May 2013 05:26:47 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kqeMUA6NnzRB for <cpan-bug+Encode [...] hipster.bestpractical.com>; Thu, 2 May 2013 05:26:46 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id B04B7240CAE for <bug-Encode [...] rt.cpan.org>; Thu, 2 May 2013 05:26:45 -0400 (EDT)
Received: (qmail 28586 invoked by alias); 2 May 2013 09:26:44 -0000
Received: from smtp-vbr11.xs4all.nl (HELO smtp-vbr11.xs4all.nl) (194.109.24.31) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Thu, 02 May 2013 02:26:37 -0700
Received: from pc09.procura.nl (adsl.procura.nl [82.95.216.30]) (authenticated bits=0) by smtp-vbr11.xs4all.nl (8.13.8/8.13.8) with ESMTP id r429QVVO018869 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for <bug-Encode [...] rt.cpan.org>; Thu, 2 May 2013 11:26:31 +0200 (CEST) (envelope-from h.m.brand [...] xs4all.nl)
Delivered-To: cpan-bug+Encode [...] hipster.bestpractical.com
Subject: Documentation buglet
Return-Path: <h.m.brand [...] xs4all.nl>
X-RT-Mail-Extension: encode
X-Original-To: cpan-bug+Encode [...] hipster.bestpractical.com
X-Spam-Check-BY: la.mx.develooper.com
Date: Thu, 2 May 2013 11:26:30 +0200
X-Spam-Level:
To: bug-Encode [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: "H.Merijn Brand" <h.m.brand [...] xs4all.nl>
X-RT-Original-Encoding: ascii
X-RT-Interface: Email
Content-Length: 1740
Download (untitled) / with headers
text/plain 1.6k
--8<--- The docs on decode tell me: decode $string = decode(ENCODING, OCTETS[, CHECK]) This function returns the string that results from decoding the scalar value OCTETS, assumed to be a sequence of octets in ENCODING, into Perl's internal form. The returns the resulting string. As with encode(), ENCODING can be either a canonical name or an alias. For encoding names and aliases, see "Defining Aliases"; for CHECK, see "Handling Malformed Data". For example, to convert ISO-8859-1 data into a string in Perl's internal format: $string = decode("iso-8859-1", $octets); CAVEAT: When you run "$string = decode("utf8", $octets)", then $string might not be equal to $octets. Though both contain the same data, the UTF8 flag for $string is on unless $octets consists entirely of ASCII data on ASCII machines or EBCDIC on EBCDIC machines. See "The UTF8 flag" below. If the $string is "undef", then "undef" is returned. -->8--- The sentence "Though both contain the same data, the UTF8 flag for $string is on" is not true: $ perl -MEncode=decode -MDP \ -wE'say$Encode::VERSION;$a=decode"utf-8","x";DDump$a' 2.51 SV = PV(0x882b5a0) at 0x883fbec REFCNT = 1 FLAGS = (POK,pPOK,UTF8) PV = 0x88c4d18 "x"\0 [UTF8 "x"] CUR = 1 LEN = 12 This is perl 5, version 16, subversion 3 (v5.16.3) built for i686-linux-64int -- H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/ using perl5.00307 .. 5.17 porting perl5 on HP-UX, AIX, and openSUSE http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/ http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/
MIME-Version: 1.0
In-Reply-To: <20130502112630.15166ea1 [...] pc09.procura.nl>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <20130502112630.15166ea1 [...] pc09.procura.nl>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.13-13651-1373998844-1106.84992-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 1814
Download (untitled) / with headers
text/plain 1.7k
Or no longer true (which used to be true a long ago). Document fixed as follows: https://github.com/dankogai/p5-encode/commit/d60373e11568d339d999e78e90bfd10d9853a089 Dan the Maintainer Thereof On Thu May 02 05:26:48 2013, h.m.brand@xs4all.nl wrote: Show quoted text
> --8<--- The docs on decode tell me: > decode > > $string = decode(ENCODING, OCTETS[, CHECK]) > > This function returns the string that results from decoding the > scalar > value OCTETS, assumed to be a sequence of octets in ENCODING, > into > Perl's internal form. The returns the resulting string. As > with > encode(), ENCODING can be either a canonical name or an alias. > For > encoding names and aliases, see "Defining Aliases"; for CHECK, > see > "Handling Malformed Data". > > For example, to convert ISO-8859-1 data into a string in Perl's > internal format: > > $string = decode("iso-8859-1", $octets); > > CAVEAT: When you run "$string = decode("utf8", $octets)", then > $string > might not be equal to $octets. Though both contain the same > data, the > UTF8 flag for $string is on unless $octets consists entirely of > ASCII > data on ASCII machines or EBCDIC on EBCDIC machines. See "The > UTF8 > flag" below. > > If the $string is "undef", then "undef" is returned. > -->8--- > > The sentence "Though both contain the same data, the UTF8 flag for > $string is on" is not true: > > $ perl -MEncode=decode -MDP \ > -wE'say$Encode::VERSION;$a=decode"utf-8","x";DDump$a' > 2.51 > SV = PV(0x882b5a0) at 0x883fbec > REFCNT = 1 > FLAGS = (POK,pPOK,UTF8) > PV = 0x88c4d18 "x"\0 [UTF8 "x"] > CUR = 1 > LEN = 12 > > This is perl 5, version 16, subversion 3 (v5.16.3) built for i686- > linux-64int >


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.