re:Have you got the hex code for that one?  I presume this is the only
> character causing difficulty - hence we really want to avoid turning
> the whole string into hex numbers - which are harder to process.



$values = unpack('H*',"$file");

output for the  entity â~@¢

HEX: e280a20a

Jon

----- Original Message -----
From: "Jonathan E. Paton" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, April 21, 2002 3:54 PM
Subject: Re: pack / unpack


> > I should have been more specific or maybe I have missed the point again
:(
> > the file is UTF-8 encoded which is fine for what I want.
> >
> > However, I need to get at bullet points within the text. these apear as
the
> > entity â~@¢ in vi.
>
> Have you got the hex code for that one?  I presume this is the only
> character causing difficulty - hence we really want to avoid turning
> the whole string into hex numbers - which are harder to process.
>
> > So I thought if could the hex value it would able to deal with any
> > regexification in that form and the go back to text.
>
> Okay, here is my slightly modified strategy if you are just wanting
> to parse the file:
>
> my $bullet = qr/\x00/; # qr = quoted regex
>
> then you can say:
>
> my ($extracted = $line) =~ /${bullet}(.*)$/;
>
> to extract the text between that character, and the end of the line.
>
> Alternatively, use the "tr" function to map the bullet to something
> better:
>
> tr/\x000/\x000/; # Put in the right hex codes
>
> Either way, you need to know what the hex code for the bullet is.
>
> > Does the solution you suggest still apply?
>
> If as understood, then definately!
>
> Jonathan Paton
>
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to