I'm sorry, but I must disagree. Based on what you've just said, the conclusion I would make is that you have not yet tried seriously to learn how perl 5.8 handles unicode; and you seem to be having trouble with regexes in general, as well.

A regex like /r\n/ (a letter "r" followed by a line-feed) has nothing whatsoever to do with "UTF-8 cleaning". I realize you probably meant /\r\n/ (CRLF), but that has nothing to do with utf8 cleaning either. (Oh, and there's a syntax error in that line.)

I don't know what you're getting at with the $reg2 = /s/ -- did you forget a backslash there as well? The foreach loop makes no sense at all, and I don't see how any of this (or Mark Davis's very useful essay on "Unicode Newline Guidelines") is at all relevant to accented letters.

The "\w" and "\W" work as expected on utf8 strings -- \w matches anything that is a letter or digit, no matter if it's ASCII, extended Latin, Greek, Arabic, Thai or whatever, and \W matches anything that is not a letter or digit. But you have to know for sure that you are applying the regex to a utf8 string that has been flagged internally by Perl as being a utf8 string. If you don't understand what that means, it's not surprising that you've had trouble with this stuff.


In reply to Re^2: French Accents in perl by graff
in thread French Accents in perl by audoushka

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.