Re: chr help

2002-07-31 Thread zentara

On Wed, 31 Jul 2002 18:17:46 +0800, [EMAIL PROTECTED] (Connie Chan)
wrote:
>> Does anyone know or can point me to a
>> location where I can find the chr() value of this character? All replies are
>> greatly appreciated.

>my @chars = split //, $line; # $line is your string.
>foreach my $char(@chars) { print sprintf"%1x", ord($char) ; print " " }
># Hope this help.

Hi, this dosn't match up the ascii character with the hex code, making
it very hard to read the output. Here is an improved version, which
prints out the hex characters vertically, directly beneath each
character. Add this to your utilities directory.
#ascii-hex-print
###
#!/usr/bin/perl -wnl012
# Prints the contents of a file a line at a time
# followed by the ASCII value of each character in vertical columns.
# Useful for debugging.
# If no filename is specified then input is read from the keyboard.
# Version 1.00 Ian Howlett [EMAIL PROTECTED] 6 July 2001
# Version 1.10 James Yolkowski [EMAIL PROTECTED] 8 July 2001

print;  
@hexvals = map {sprintf "%02X", ord $_} split //;  
for $a (0, 1) {print map {substr $_, $a, 1} @hexvals}
#



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: chr help

2002-07-31 Thread chris

The display character for ASCII text depends on the font selected. If
you are using Times New Roman or New Courier, there is a longer dash
at chr(151).

Sounds like Word will save the doc as entered and do the changes on
the fly.

On Tue, 30 Jul 2002 23:49:12 -1000, [EMAIL PROTECTED] (Beau E. Cox)
wrote:

>Hi -
>
>I built a tiny .doc file with MS Word 2000 containing the text:
>
>hello - world
>
>Word did change the dash to a "long" dash on the screen.
>
>Next, I opened the .doc file in binary mode (I my case, using the
>C++ built-in editor) and found that line:
>
>48 65 6C 6C 6F 20 96 20  77 6F 72 6C 64 0D 0D 0D
>-or-
>h  e  l  l  o -- w  o  r  l  d
>
>So the long dash is hex 96 or chr (150)
>
>Aloha => Beau.
>
>-Original Message-
>From: Gabby Dizon [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, July 30, 2002 8:23 PM
>To: [EMAIL PROTECTED]
>Subject: chr help
>
>
>Hi,
>
>I have a subroutine that finds commonly found Unicode characters that
>Microsoft Word uses (such as "smart quotes") and converts them to plain
>ASCII text. However, there is one character whose chr() value I can't seem
>to find - the MS Word long dash, which automatically replaces the normal
>(short dash) when you press Enter. Does anyone know or can point me to a
>location where I can find the chr() value of this character? All replies are
>greatly appreciated.
>
>Gabby Dizon
>Web Developer
>INQ7 Interactive, Inc.
>http://www.inq7.net
>http://you.inq7.net


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: chr help

2002-07-31 Thread Beau E. Cox

Hi -

I built a tiny .doc file with MS Word 2000 containing the text:

hello - world

Word did change the dash to a "long" dash on the screen.

Next, I opened the .doc file in binary mode (I my case, using the
C++ built-in editor) and found that line:

48 65 6C 6C 6F 20 96 20  77 6F 72 6C 64 0D 0D 0D
-or-
h  e  l  l  o -- w  o  r  l  d

So the long dash is hex 96 or chr (150)

Aloha => Beau.

-Original Message-
From: Gabby Dizon [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 30, 2002 8:23 PM
To: [EMAIL PROTECTED]
Subject: chr help


Hi,

I have a subroutine that finds commonly found Unicode characters that
Microsoft Word uses (such as "smart quotes") and converts them to plain
ASCII text. However, there is one character whose chr() value I can't seem
to find - the MS Word long dash, which automatically replaces the normal
(short dash) when you press Enter. Does anyone know or can point me to a
location where I can find the chr() value of this character? All replies are
greatly appreciated.

Gabby Dizon
Web Developer
INQ7 Interactive, Inc.
http://www.inq7.net
http://you.inq7.net


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]