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

Re: UTF8 flag and sv_utf8_upgrade

From:
Simon Cozens
Date:
December 12, 2000 13:28
Subject:
Re: UTF8 flag and sv_utf8_upgrade
Message ID:
20001212212758.A24999@deep-dark-truthful-mirror.perlhacker.org
On Tue, Dec 12, 2000 at 07:22:16PM +0000, Nick Ing-Simmons wrote:
> 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); 

I don't understand the problem you have with that. If you're adding UTF8
data to a non-UTF8 string, you *have* to upgrade the non-UTF8 string.
Absolutely have to. Perl doesn't care whether data is UTF8 or not, so
long as it can get things done correctly, nor should it; if Tk *does*
care, it should do the running.

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

Doesn't care about what? Getting sane results back? One *must* call
upgrade if one has UTF8 data. Period.

-- 
And it should be the law: If you use the word `paradigm' without knowing
what the dictionary says it means, you go to jail.  No exceptions.
		-- David Jones



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