Click here to get back home

utf8 issue with substitution pattern

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
utf8 issue with substitution pattern Vorxion 04-18-2005
Get Chitika Premium
Posted by Vorxion on April 18, 2005, 10:30 pm
Please log in for more thread options
>>
>> [snip]
>>
>> > if I print "$1\n",
>> > the file prints just fine. But, if I do something like print "$1 after
>> > \n", the whole output is messed up. If I print "before $1\n", nothing
>> > prints at all. If I print "before $1 after\n", only after prints.
>>
>> not really sure, but could be a rogue "\r" in $1,


> There
> is a rogue carriage return (0xd) in the string

> Is there something I can do to deal with this
> situation?


Repair the corrupted file:

perl -p -i -e 'tr/\r//d' bad_file


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas

Similar ThreadsPosted
possible ActivePerl substitution optimisation issue June 12, 2007, 2:23 pm
Pattern substitution February 3, 2006, 2:50 pm
pattern substitution question April 21, 2006, 1:10 pm
Need help with pattern matching/substitution. September 26, 2006, 6:31 pm
second substitution to work only on a found pattern October 9, 2006, 1:02 pm
speed issues with pattern matching and substitution April 4, 2005, 7:26 am
How to NOT use utf8. February 18, 2005, 9:51 pm
Re: uc() and utf8 February 26, 2008, 6:40 am
decoding utf8 September 22, 2005, 8:22 am
UTF8 to ASCII? January 5, 2006, 3:49 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap