Actually, I was faced with the same problem.
After fixing other issues (thank god for PerlMonks!), I found the cure:
use Win32::OLE qw(CP_UTF8);
...
# Work in unicode!
$Win32::OLE::CP = CP_UTF8;
...
You can use Unicode::String to unpack() the string to look at each unicode char (which was what I had to do).
Cheers
---Lars | [reply] [d/l] |
Actually, using Unicode::String as a container for your data is not needed (in fact, it will croak on acctented chars and other punctuation). Just use the string as you 'normally' do, i.e. to look at each char:
for my $uchar (split(//, $text)) {
my $ord = ord($uchar);
...
}
While it seems natural to me now, it took me some time to locate that my troubles with unicode strings was *using* Unicode::String... :-)
---Lars
| [reply] [d/l] |
Do you have an example of a your Unicode string so that I can test? Odds are you are going to be playing with Variant (specifically VT_BSTR), but I don't want to steer you in the wrong direction.
C-.
---
Flex the Geek | [reply] |