in reply to trouble with umlauts

This is all IIRC; and I don't Recall Correctly fairly often.

One of the remaning problems with unicode is that regexes decide to match against unicode or nonunicode based solely on if it thinks the regex is unicode. Try forcing the matter by starting the regex with a unicode character. Adding ö{0} to the beginning should do it.

Try reading the "fixed bugs" section of a newer perl to see what bugs you have.

Replies are listed 'Best First'.
Re: Re: trouble with umlauts
by theorbtwo (Prior) on Mar 19, 2002 at 18:54 UTC

    BTW, this post is mine; I didn't relise that I wasn't yet logged in.

    I just remembered somthing that I had forgotten and I don't think anybody else mentioned: Have you used utf8? Is the file acatualy being stored as utf8 (your script, that is)?


    We are using here a powerful strategy of synthesis: wishful thinking. -- The Wizard Book

      How can i see, in which encoding it is stored?

      Would be interesting for me, although i found a solution to the problem.

        Take a look at the file in a win9x ('95, '98, 'ME) version of notepad, or another editor you know doesn't deal with utf8. If the non-low-ascii (IE s-sets and umlouted vowels) show up as two characters, it's utf8 (or some really funky encoding). If they show up as one, then it's not.

        From Re: trouble with umlauts - update, "encodes the ö as %C3%B6 that causes the regex to not match, or as %F6 which causes a match there" suggests that it's sometimes being encoded as UTF-8 (0xC3 B6), and sometimes as somthing else (0xF6).

        The fact that it's matching when it's F6 but not C3 B6 suggests that your input isn't getting normalized to utf8 at all, but rather to that other encoding.

        All in all, it doesn't really matter what encoding it gets into, so long as the encodings match everwhere they need to. (I'd recommend utf8, because it's becomming the clear standard, and because XML is assumed utf8 unless otherwise marked.)

        What was the solution you found?


        We are using here a powerful strategy of synthesis: wishful thinking. -- The Wizard Book