RFC: interactions between "use bytes", "use locale", and "use feature 'unicode_strings'

I am waiting for blead to reopen before I submit a patch for extending 
feature unicode_strings to matching \s, and \w.  In documenting it, it 
occurred to me that the existing implementation is wrong, along with the 
existing interaction between use bytes and use locale.

To refresh your memory, "use feature 'unicode_strings'" is supposed to 
mean that even non-utf8 data is to be considered to have Unicode 
semantics.  In practice, this only affects the characters from 128-255.

It is new in 5.12, and is implemented there only on functions that 
change case, such as ucfirst(), and s/.../\L...\E/.

The implementation is that it is always subservient to 'use bytes' and 
'use locale'.  Thus, in
	use bytes;
	code 1
	{
	   use feature "unicode_strings"
	   code 2
	}
         code 3

byte semantics is used throughout.  It seems to me that instead unicode 
semantics should be used in code 2; byte semantics in codes 1 and 3.

Similarly with locale; unicode_strings is subservient to that, and I 
think they should behave instead as I just suggested for bytes.

And, I think that bytes and locale should similarly override each other, 
which they don't currently.

I believe that the implementation of hint_bits must currently stack it, 
so that when an interior block is popped, the value for the outer block 
is automatically restored.

Any comments?
0
public
5/10/2010 7:04:06 PM
perl.perl5.porters 47705 articles. 1 followers. Follow

1 Replies
758 Views

Similar Articles

[PageSpeed] 57

On Mon, May 10, 2010 at 3:04 PM, karl williamson
<public@khwilliamson.com> wrote:
> I am waiting for blead to reopen before I submit a patch for extending
> [SNIP]
> Any comments?

FYI, blead is open.  Only the maint-5.12 branch is closed.

-- David
0
xdaveg
5/10/2010 8:25:00 PM
Reply:

Similar Artilces:

RFC: Make "use 5.14" select "use re '/a' " ?
I have pushed to blead (with Jesse's permission) the last commits (besides doc and any bug fixes) that enable the /a regular expression modifier. Presuming it works ok, should this become the default method of operation, signified by a "use 5.014" ? On 1/17/11 11:02 AM, Karl Williamson wrote: > Presuming it works ok, should this become the default method of > operation, signified by a "use 5.014" ? So when I upgrade my code, I have to put "no re '/a'" in every file? Why, oh why? On Mon, 17 Jan 2011, Elliot Shank wrote: > ...

[ID 20020307.006] [BUG][use encoding] use encoding 'greek'; print "not" unless pack("U*", 0x3af) eq pack("C*", 0xdf) prints "not"!
This is a bug report for perl from "Anton Tagunov" <tagunov@motor.ru>, generated with the help of perlbug 1.33 running under perl v5.7.3. ----------------------------------------------------------------- Hello, developers! Hello, Jarkko! Please consider the following test being added: --- lib/encoding.t.orig Fri Feb 8 07:12:05 2002 +++ lib/encoding.t Thu Mar 7 19:38:39 2002 @@ -1,4 +1,4 @@ -print "1..19\n"; +print "1..20\n"; BEGIN { if (ord("A") == 193) { @@ -89,3 +89,7 @@ print "not " unless "\x...

"Using" or "With"
Hi all Please can someone enlighten to me as regards the difference with the "Using" and "With" statement when accessing data - which is better, what are the limitations and/or any pointers. Many thanks. Regards DaveDavid WinchesterPlease mark as answer if this is the solution.  using gives you the ability to use the connection and it closes the connection directlly after you finish using it. and there is no need to try- cach - finaly. there is no limitation on using USING keywordMuhanad YOUNISMCSD.NETMy Blog || My Photos || LinkedIn I have a dataobject the re...

Using "+" or "||"
Using SQLAnywhere 5.5.04, I've gotten into the habit of using "||" in ISQL to indicate a string concatenation. I needed to paste my SQL statement into the PowerBuilder script painter for some embedded SQL, and PB didn't like the "||" very much at all. I changed it to "+" and it seems to be ok. Do these two operators indicate ~exactly~ the same thing? moin, afaik these two's are not the same! if you're using "||" and any term is NULL then in the resultstring the term will be ignored if you use "+" then the resu...

I'm getting an error using NavigateURL ='<%# Eval("Url") %>', it works when using NavigateURL="intro.aspx"
I'm getting an error using NavigateURL ='<%# Eval("Url") %>', it works when I use NavigateURL="intro.aspx" Server Error in '/orthoassist' Application. The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly. Requested URL: /orthoassist/intro.aspx <asp:HyperLink runat="server" ID="hl1" Text=...

What to use instead of "cin" and "cout" which VCL doesn't use
I want to ask the user their name which I will then put on a label. There may be a better way but in the meantime I have used a TextOut message to Ask for their name and then put a memo box at the end of the sentence, which I find they can type into, I think. Question is How can I get or where to I find what they typed so I can put it in my label storage. I notice that there is a "Lines" property for Memo that say TString and if you click on it you get a code editor. I have been reading for days but I can figure out where to go from here. Any help would be greatly apprecia...

(setxkbmap) can't use "ALT_GR"/"left ALT" button after using it
hello folks i use LXDE as i'm known and my only solution to switch keyboard is to use setxkbmap now after i define keyboards layouts to switch and chose ALT+Shift to switch it goes "bugged" using the right ALT will switch the layouts and i'm not able to write the "other" letters help please P.S : this is the command i use �setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll fr,ar� -- SAFAD ------------------------------------------------------------------------ bump up rotfl! -- SAFAD -------------------------------...

RE: Using "do" versus "use" for subroutine
Edward Wijaya wrote: > Hi, > > I would like to know which of this > is better and what is the pro and cons: > > 1. A file "mysub.pl" which stored > a subroutine, and later called by > main file using: do "mysub.pl" > > or > > 2. A file "mysub.pm" and called > in main file using : use "mysub.pm" The second construct is not valid; the argument to "use" must be a bareword. It's not really possible to answer your question without knowing more details. I'm not clear about what&#...

Replacing "use base" with "use parent"
--bcaec554da9c7514d304ca32ffa3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, From the base.pm documentation<http://perldoc.perl.org/base.html#DESCRIPTIO= N>: Unless you are using the fields pragma, consider this module discouraged in favor of the lighter-weight parent . From the parent.pm documentation<http://perldoc.perl.org/parent.html#HISTOR= Y> : This module was forked from base to remove the cruft that had accumulated in it. parent.pm is a 30 lines pure Perl dual module available also in core since 5.10...

how to use "Match" the special char "\" as using filter
Thx JJ \\ "JJ" <jasonyklau@sinaman.com> wrote in message news:404bd593$1@forums-2-dub... > Thx > JJ > > ...

Can't use string ("1") as a HASH ref while "strict refs" in use at ./policy.sanitizer line 255.
Hi there, I am trying to figure out why the following lines are giving me an error: --- snip --- $found{filter}{$filter}{family}{$family} = 1; print keys %{ $found{filter}{$filter}{family} }; --- snip ---- here's the error Can't use string ("1") as a HASH ref while "strict refs" in use at ../policy.sanitizer line 255. I am trying to the display all the keys for $found{filter}{$filter}{family} please Cheers, Noah On 10/9/09 Fri Oct 9, 2009 2:12 PM, "Noah" <noah-list@enabled.com> sc...

Using cdate function but got error "Conversion from string " " to type 'Date' is not valid."
I want to control user's input in Due date text box like below to make sure that user does not input date earlier than today: If Me.txtDueDate.Text <> "" Then      If (DateDiff("d", CDate(Me.txtDueDate.Text), (Date.Today)) > 0) Then     // Message: due day should not be earlier than today      exit sub End If  The problem is: if user did not input anything in txtDueDate box, I still got error: Conversion from string "  " to type 'Date' is not valid How to fix it? Help!!!   I'd use a RequireFie...

use of "?" operator instead of "if"
Hi: I have this statement which checks for existence of the $VAL variable and performs certain actions if($VAL){ $VAL = "$VAL:$expr"; } else { $VAL = "$expr"; } Can this 4 line statement be reduced to a single line using "?" operator? Thanks Ravi __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - File online, calculators, forms, and more http://platinum.yahoo.com It's called the ternary operator, and works like this: $VAL ? $VAL = "$VAL:$expr" : $VAL = "$expr"; IF_EXPR ? T...

Syntax of "use"/"require"
(This thread is referencing http://www.perlmonks.org/?node_id=3D461105) I'd like to start writing the Module::Build/ExtUtils::MakeMaker for Pugs. One of the first things that was mentioned was that the syntax for use needs to support specifying the exact version or range of versions you want to have. There has also been mention of the fact that module installation needs to tag the author, as well as other features. Would someone please mind listing all the functionality desired for module installation as seen from "use"? Thanks, Rob On 5/28/05, Rob Kinyon <ro...

Web resources about - RFC: interactions between "use bytes", "use locale", and "use feature 'unicode_strings' - perl.perl5.porters

Resources last updated: 11/29/2015 11:09:22 PM