Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Test::* vs. utf8 pragma

by jk2addict (Chaplain)
on Jan 13, 2005 at 02:49 UTC ( [id://421855]=perlquestion: print w/replies, xml ) Need Help??

jk2addict has asked for the wisdom of the Perl Monks concerning the following question:

I'm having a strange problem that I can't seem to track down. I'm working on a set of modules for a quick n dirty site conversion at home; the bulk of which is just shopping cart/AxKit stuff. I've got a base Exception module that also makes use of Locale::Maketext and two test language files.

Under one 5.6.1 install on win32, this test script fails when comparing the output string to the expected string on all tests. Even funnier is that visually, the "got" and "expected" test output loos the same. Through various encantations of the utf pragma it came down to not using utf8 under 5.6.1, and using it under 5.8.4; both of which worked. One my other 5.6.1 install, it failed without utf8, and passed when I put use utf8 back in.

So, I've got two 5.6.1 installs with the same Locale::Maketext and the Test::Simple. On fails with use utf8, on passes with use utf8.

I don't know where to begin to identify the problem. Any pointers or nuggest of wisdom? The test itself is trying to very that L10N happens correctly.

Thanks, -=Chris

Replies are listed 'Best First'.
Re: Test::* vs. utf8 pragma
by PodMaster (Abbot) on Jan 13, 2005 at 08:47 UTC
    So, I've got two 5.6.1 installs with the same Locale::Maketext and the Test::Simple. On fails with use utf8, on passes with use utf8.

    I don't know where to begin to identify the problem.

    In general, you start by examining those two 5.6.1 installs to see what's different between them (You examine %ENV, you examine %INC, you examine `perl -V`).

    On the other hand, Locale::MakeText itself uses utf8, so you need to use utf8 regardless of the version of perl, especially if you're going to embed utf8 in source.

    update: I'm betting you just got confused whilst turning utf8 on/off, and you compared one perl5.6.1 with utf8 on, and the other with utf8 off.

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      Well, I'm 99.99% sure I wasn't confused. Basically, I developed under 5.6.1/5.8.4 on the laptop. 5.8.4 passed the test with 'use utf8', and 5.6.1 failed it with utf8 loaded until I removed it; then 5.6.1 passed without it.

      I checked the source into SVN and checked it out on the the desktop upstairs. 5.8.4 passed with utf8. 5.6.1 on the desktop FAILED the test without use utf8. So, I put utf8 back in for 5.6.1 and it too passed. I checked in to SVN and went back downstairs to the laptop.

      I checkout out the SVN on the laptop. 5.6.1 failed with utf8 loaded, and 5.8.4 passed. I removed utf8 from that test and 5.6.1 now passed. Rinse, Lather, Repeat.

      Thus far, these things are the same between the laptop and desktop: XP SP2, ActiveState Perl 5.6.1.630, Class::DBI, DBI, Error, Locale::Maketest, I18N::LangTags, and Win32::Locale, Test::Simple.

      This is why the plea for help. Nothing is standing out as a reason why use utf8 make string compares fail from one install to the next. Should I even be using utf8 in the test, or just in the language files that actually have UTF8 text in the %Lexicon source?

Re: Test::* vs. utf8 pragma
by jk2addict (Chaplain) on Jan 14, 2005 at 01:32 UTC

    It's a good thing I'm not a total idiot or anything:

    Locale::Maketext 1.06 ChangeLog:
    
    2003-06-21  Sean M. Burke  sburke@cpan.org
    	* Release 1.06:  Now has "use utf8" to make the things work
    	happily.  Some fancy footwork is required to make this work under
    	pre-utf8 perl versions.
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://421855]
Approved by Old_Gray_Bear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-25 09:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found