Special characters: (TM), (R)

Discussion in 'Ruby' started by Phil Tomson, Mar 6, 2004.

  1. Phil Tomson

    Phil Tomson Guest

    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
     
    Phil Tomson, Mar 6, 2004
    #1
    1. Advertising

  2. Phil Tomson

    Tim Bates Guest

    Phil Tomson wrote:
    > 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.

    --
    Tim Bates
     
    Tim Bates, Mar 6, 2004
    #2
    1. Advertising

  3. On Mar 5, 2004, at 8:03 PM, Tim Bates wrote:
    > Phil Tomson wrote:
    >> 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)".


    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

    --
    (-, /\ \/ / /\/
     
    Gavin Kistner, Mar 6, 2004
    #3
  4. Phil Tomson

    Phil Tomson Guest

    In article <>, Tim Bates <> wrote:
    >Phil Tomson wrote:
    >> 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)".
    >


    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
     
    Phil Tomson, Mar 6, 2004
    #4
  5. Phil Tomson

    Mark Hubbart Guest

    Hi,

    > On Mar 5, 2004, at 8:03 PM, Tim Bates wrote:
    >> Phil Tomson wrote:
    >>> 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)".


    It looks like a character encoding issue... When I set my terminal to
    use the "Western (Windows Latin 1)" encoding, I can do this:
    >> 174.chr.display

    ®=> nil
    >> 153.chr.display

    ™=> 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.

    On Mar 5, 2004, at 7:56 PM, Gavin Kistner wrote:
    > 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
     
    Mark Hubbart, Mar 6, 2004
    #5
  6. 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
    --
    E-Mail: .--- ..- .--. .--. .--.-. --. -- -..- .-.-.- -.. .
    http://oss.erdfunkstelle.de/ruby/ - German comp.lang.ruby FAQ
    http://rubyforge.org/users/jupp/ - Ruby projects at Rubyforge
    - .-.
     
    Josef 'Jupp' SCHUGT, Mar 7, 2004
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jonah Olsson

    Special characters with DrawString?!

    Jonah Olsson, Oct 1, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    3,434
    Dmitriy Lapshin [C# / .NET MVP]
    Oct 3, 2003
  2. Stefan Mueller
    Replies:
    3
    Views:
    33,126
    Stefan Mueller
    Jul 23, 2006
  3. Replies:
    2
    Views:
    1,114
    Ingo Menger
    May 31, 2007
  4. rvino
    Replies:
    0
    Views:
    4,678
    rvino
    Aug 14, 2007
  5. majna
    Replies:
    4
    Views:
    702
    Thomas 'PointedEars' Lahn
    Sep 19, 2007
Loading...

Share This Page