OK. Now I can do "simple" replacement on a Unicode string read from a file.
For example, if "Test" (T\x00e\x00s\x00t\x00") is in the file then I can
replace it with "TEST". What if I have "Test\=0\;" and I want to replace the
numeric part with a different number? Normally I would do something like:
s/Test\\=([0-9]+)\\;/Test\=Number\;/;
Which would replace the numeric portion with "Number". If I simple try to
expand each side of the substitution into UTF16 it does not work. How do I
do this?
Thanks again.
Kevin Burton
[EMAIL PROTECTED]
-----Original Message-----
From: Philip Newton [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 08, 2000 9:32 AM
To: '[EMAIL PROTECTED]'; Perl-Win32-Users Mailing List
Subject: Re: Finding and replacing a UNICODE string.
[EMAIL PROTECTED] wrote:
> Do I need to do the "expansion" thing for each string that I want to
> replace?
Yes, because in the file you have the "expanded" version. So if you want to
match it, you need an "expanded" version of a search string.
Example, the file has "T\00e\x00s\x00t\x00" in it, then you can't match that
string with /Test/.
And while Perl 5.6 can handle UTF-8 internally, AFAIK it doesn't yet
recognise UTF-8 read from a file (you'd have to tell Perl manually to treat
it as UTF-8, don't know how) -- but they're working on that (key word "input
disciplines" or so).
Cheers,
Philip
---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]