Click here to get back home

print chinese char

 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
print chinese char Alexandre Jaquet 09-09-2005
`--> Re: print chinese char Alexandre Jaque...09-09-2005
Get Chitika Premium
Posted by Alexandre Jaquet on September 9, 2005, 9:05 am
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

Posted by Alexandre Jaquet on September 9, 2005, 9:17 am
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
regex dingbat dodge - single char as string to repeatable single char. January 25, 2008, 2:16 pm
how to read Chinese filenames? June 5, 2006, 5:49 pm
I use TK to show some chinese web page, I get nothing,why? November 25, 2006, 9:00 pm
char->integer, integer->char commands November 21, 2005, 10:24 am
Looking for Chinese->English Translation Script September 13, 2005, 8:29 pm
could XML::Simple handling chinese character? June 16, 2007, 11:55 pm
Welcome to my webside that provides help in English Study for Chinese.. January 14, 2008, 8:46 am
anybody have experience in url decode (included chinese gb2312 character) ? August 27, 2004, 1:39 pm
www.hetong168.com Chinese biggest contract website first A2A gateway October 17, 2005, 11:02 pm
Create a chinese directory (folder) by Perl in Windows 2000 English OS September 21, 2004, 4:51 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap