Umlauts

They have: 297 posts

Joined: Apr 1999

Hi,

does anybody here know a good way to handle German Umlauts in Perl, so they can be matched with RegExes?

Later,

Malte

------------------
Malte Ubl - www.Boardzilla.org
Communication: public<->programmers
of the Boardzilla BB

They have: 297 posts

Joined: Apr 1999

I'm so sorry Pat...rick.

Seems like UBB is able to handle em.

Malte

------------------
Malte Ubl - www.Boardzilla.org
Communication: public<->programmers
of the Boardzilla BB

They have: 297 posts

Joined: Apr 1999

Hey Patty,

you should have had this problem before

Later,

Malte

------------------
Malte Ubl - www.Boardzilla.org
Communication: public<->programmers
of the Boardzilla BB

They have: 850 posts

Joined: Jul 1999

Pardon my ignorance, but what are German Umlauts?

------------------
1 in 5,000 north atlantic lobsters are born bright blue.

They have: 297 posts

Joined: Apr 1999

I love this community

Malte

They have: 297 posts

Joined: Apr 1999

I got a weired solution to this problem:

$form = form input = "ä"; # data from a web form
$file = file input = "ä"; data read from a file

$file ~= /$form/ # -> false

$form ~= s/ä/§§§/g;
$file ~= s/ä/§§§/g;

$file ~= /$form/ # -> true

This is just example code, so it might have some syntax errors, but thats not the point.

Why does the substitute operator match something which the simple match operator doesnt match???

Malte

[This message has been edited by Malte (edited 27 January 2000).]

They have: 850 posts

Joined: Jul 1999

You could convert the string into it's ascii value.

So

$form = "ä";
$formascii = join('', unpack('c*', $form));

$file = "ä";
$fileascii = join('', unpack('c*', $file));

than do your regexp.

Hope that helps

------------------
Dogs and cats consume over $11 billion worth of pet food a year.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.