Special characters: (TM), (R)

P

Phil Tomson

I need to output a company name and legal requires that we put the
circle R after the name as in Zowcorp(R). In some other cases we need
the trademark (TM) symbol.

I did this to try to find them:

(0..255).each {|i|
puts i.to_s+" "+i.chr
}

But I didn't find them in there... Which makes me wonder if it's even
possible to output them this way. I know that to get them in HTML you
use ® and ™

Phil
 
T

Tim Bates

Phil said:
But I didn't find them in there... Which makes me wonder if it's even
possible to output them this way. I know that to get them in HTML you
use ® and ™

`puts 174.chr` gives me a little (R) symbol that's rather difficult to
read, and `puts 153.chr` gives me a dotted square - so I guess it
depends on what terminal font you're using. I assume you're wanting to
do this in a terminal window? The answer probably is that there's no
guaranteed portable way to do it except for "(R)" and "(TM)".

Tim.
 
G

Gavin Kistner

`puts 174.chr` gives me a little (R) symbol that's rather difficult to
read, and `puts 153.chr` gives me a dotted square - so I guess it
depends on what terminal font you're using. I assume you're wanting to
do this in a terminal window? The answer probably is that there's no
guaranteed portable way to do it except for "(R)" and "(TM)".

Vaguely related (and important for everyone to read, IMO):

"The Absolute Minimum Every Software Developer Absolutely, Positively
Must Know About Unicode and Character Sets (No Excuses!)"
http://www.joelonsoftware.com/articles/Unicode.html
 
P

Phil Tomson

`puts 174.chr` gives me a little (R) symbol that's rather difficult to
read, and `puts 153.chr` gives me a dotted square - so I guess it
depends on what terminal font you're using. I assume you're wanting to
do this in a terminal window? The answer probably is that there's no
guaranteed portable way to do it except for "(R)" and "(TM)".

I think you're right. Now that I'm on a LInux box I see the (R) char
(puts 174.chr) but I don't see the (TM) symbol (puts 153.chr).
Previously, I was trying this on Windows and saw neither of them.

Phil
 
M

Mark Hubbart

Hi,

It looks like a character encoding issue... When I set my terminal to
use the "Western (Windows Latin 1)" encoding, I can do this:™=> nil
But with it set to unicode (the way I usually have it), it give nice
little question marks instead of characters. I think Tim is right, in
the terminal, you may want to use (R) and (TM). If you are using it in
a cgi script, though, just set the character encoding correctly and you
should be okay.

Vaguely related (and important for everyone to read, IMO):

"The Absolute Minimum Every Software Developer Absolutely, Positively
Must Know About Unicode and Character Sets (No Excuses!)"
http://www.joelonsoftware.com/articles/Unicode.html

Hey! great link! I'd been meaning to read up more on unicode, but
hadn't found enough information in one place... I read the first bit,
and it looks good (and it's not too dry, either).

--Mark
 
J

Josef 'Jupp' SCHUGT

Hi!

* Phil Tomson:
I need to output a company name and legal requires that we put the
circle R after the name as in Zowcorp(R).

In my complete list of ISO 8859 charsets I only find ® in

ISO 8859-1 (West Europe)
ISO 8859-8 (Hebrew)
ISO 8859-9 (Turkish)
ISO 8859-13 (Baltic Rim)
ISO 8859-14 (Celtic)
ISO 8859-15 (West Europe)

ISO 8859-2 through -7 and -9 through -11 (-12 does not exist) don't
contain it.
In some other cases we need the trademark (TM) symbol.

(TM) cannot be found in *any* of the ISO 8859 standard charsets. It
also cannot be found in any of the DOS codepages, EBCDIC codpages or
ISO 646 charsets I know (and I am quite sure to know all of them).
The only charsets I found them in are Windows codepages and Unicode.

Unfortunately my knowledge of ISO 2022 is by far too limited to make
a statement about the codes defined by it.

Josef 'Jupp' SCHUGT
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top