Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: Unicode and Regexps: convert or am I missing something?

by dakkar (Hermit)
on Jun 02, 2005 at 10:13 UTC ( #462840=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Unicode and Regexps: convert or am I missing something?
in thread Unicode and Regexps: convert or am I missing something?

use Encode; my $string=Encode::decode('UTF-16LE',$data_from_google); $string=~/what you want/;

from_to is the wrong function to use. It converts between byte strings, but to correctly work with regexp you need character strings, so you need to use decode

-- 
        dakkar - Mobilis in mobile

Most of my code is tested...

Perl is strongly typed, it just has very few types (Dan)


Comment on Re^3: Unicode and Regexps: convert or am I missing something?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://462840]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2015-07-08 07:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (96 votes), past polls