develooper Front page | perl.perl5.porters | Postings from December 2000

Re: UTF8 flag and sv_utf8_upgrade

Thread Previous | Thread Next
From:
Nick Ing-Simmons
Date:
December 12, 2000 11:24
Subject:
Re: UTF8 flag and sv_utf8_upgrade
Message ID:
E145v0C-0004b0-00@roam1
Simon Cozens <simon@cozens.net> writes:
>On Tue, Dec 12, 2000 at 12:30:02PM +0000, Nick Ing-Simmons wrote:
>> Is there any reason NOT to turn on SvUTF8 once we have established 
>> that it is valid UTF8 - even if only because it has no high bit chars?
>> Should perl do this or should Tk do it ?
>
>I think Tk should do that. Perl doesn't want to force everything into UTF8,
>Tk does.

That is what it does now - my problem was that with the various copies and 
mortals etc. perl gave me back another SV with it turned off again - but 
such is the world of gluing two packages with different assumptions.
(Tcl is everything-is-utf8 (even binary data)). 


None the less there are a few spots which do this kind of thing: 

 if (extra_data_is_utf8)
  {
   sv_utf8_upgrade(sv);
  } 
 add_extra_stuff.
 SvUTF8_on(sv); 

e.g. sv_catsv  (maybe it's the only one ...)


It seems to me that if one does not _care_ then one does not call 
upgrade in the first place.

-- 
Nick Ing-Simmons


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About