Transliteration error??

Posted on 2005-04-05
Last Modified: 2012-05-07
I'm having problems with this form-email script that used to work before I changed ISPs??? I get an error of:

 Invalid range "þƒ¿¿¿¾€-3" in transliteration operator ...

on this line:

 $realname =~ tr# a-zA-Z0-9_\-,./'\200-377##dc;


sub cleanup_realname {
  my ($realname) = @_;

  return '' unless defined $realname;

  $realname =~ s#\s+# #g;

  if ($secure) {
    # Allow no unusual characters and impose a length limit. We
    # need to allow extended ASCII characters because they can
    # occur in non-English names.
    $realname =~ tr# a-zA-Z0-9_\-,./'\200-377##dc;
    $realname = substr $realname, 0, 128;
  } else {
    # Be as generous as possible without opening any known or
    # strongly suspected relaying holes.
    $realname =~ tr#()\\#{}/#;

  return $realname;
Question by:894359
    LVL 18

    Expert Comment

    hey! I get the same:

    $ perl
    $realname =~ tr# a-zA-Z0-9_\-,./'\200-377##dc;
    Invalid range "þ¿¿¿¾-3" in transliteration operator at - line 1.

    Maybe you meant:

    $realname =~ tr# a-zA-Z0-9_\-,./'\200-\377##dc;

    Author Comment

    No, that used to work the way it was??
    LVL 18

    Accepted Solution

    Do you happen to know which version of perl your old ISP used, and which version your new ISP has?
    I tried it in 5.8.4, and got the same error you did. I just tried it in 5.6.1, and got no error.

    Author Comment

    No, but I can find out! That probably is the problem! Makes sense!

    Author Comment

    You are correct!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
    I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    This video discusses moving either the default database or any database to a new volume.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now