[sf-perl] Printing TM trademark symbol in perl
Francisco Obispo
fobispo at isc.org
Thu Feb 9 09:39:34 PST 2012
On Feb 9, 2012, at 12:32 PM, Dodger wrote:
> Moreover even if he changes the character set so it displays right in his viewer or editor, if that file is supposed to be used by someone else in a different environment that may expect a different charset it won't work.
>
right. this is why I think is a very bad idea to rely on the character if the file doesn't contain encoding information.
HTML and XML files can include an encoding instruction for the client to set it.
> Perl can't help that. About the only way around it is using some format like XML in which the character set can be explicitly specified.
>
Perl can check the client encoding (i.e. by looking at $ENV{LANG}) and determining whether is capable of displaying the character or not. That's usually what happens with some libraries that use encodings.
> Sent from my iPhone
>
> On 09/02/2012, at 9:26 AM, Francisco Obispo <fobispo at isc.org> wrote:
>
>> exactly.
>> It's how you interpret it, as long as it is the right character.
>>
>> Francisco
>>
>>
>> On Feb 9, 2012, at 12:22 PM, Dodger wrote:
>>
>>> It seems to me the problem isn't printing any given character into a file but, rather, whatever is being used to display the file not rendering the right character.
>>>
>>>
>>> Sent from my iPhone
>>>
>>> On 09/02/2012, at 8:35 AM, Francisco Obispo <fobispo at isc.org> wrote:
>>>
>>>> you need to check your encoding to make sure that they match, and if they don't set them properly.
>>>>
>>>> LANG="en_US.UTF-8"
>>>>
>>>> or any other UNICODE-compatible encoding.
>>>>
>>>> It is generally a bad idea to rely on it because it if clients don't understand UNICODE they will see whatever character correspond to their table⦠and believe me, it's even worse when the client doesn't support multi-byte characters (in general).
>>>>
>>>> Francisco
>>>>
>>>> On Feb 9, 2012, at 8:27 AM, Richard Reina wrote:
>>>>
>>>>> Hi Franisco, Your suggestion as well as print chr('8482') works. However, it only works on my Ununtu Machines that are running Xwindows. When I try it on a Centos machines in console mode it prints the circled "r" for registered trademark. Would anyone know why this is and how to get the TM to print on a Centos machine?
>>>>>
>>>>>
>>>>>
>>>>> 2012/2/8 Francisco Obispo <fobispo at isc.org>
>>>>> Actually in UTF-8 its: 8482
>>>>>
>>>>>
>>>>> perl -e 'use Encode; map { printf(qq{char %d is: %s\n},$_,encode_utf8(chr($_)))} (8482)'
>>>>>
>>>>>
>>>>> http://www.fileformat.info/info/unicode/char/2122/index.htm
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Feb 8, 2012, at 6:42 PM, Francisco Obispo wrote:
>>>>>
>>>>>> I was hoping it would show up in the table.
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Feb 8, 2012, at 6:36 PM, Richard Reina wrote:
>>>>>>
>>>>>>> I don't know whether it is or not. I was hoping it was because I have to find a way to print it.
>>>>>>>
>>>>>>> 2012/2/8 Jeff Bragg <jackofnotrades at gmail.com>
>>>>>>> Is that actually in the ASCII set? I see (in the output from a for loop printing the characters for ordinals 10 - 255) the circled 'r' (ord 174) and the copyright symbol (ord 169), but no trademark symbol.
>>>>>>>
>>>>>>> 2012/2/8 Richard Reina <gatorreina at gmail.com>
>>>>>>> I am needing to print the TM symbol for a trademark into a regular ascii text file and having no luck doing so. Does anyone know how?
>>>>>>>
>>>>>>> Thanks for any help.
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> SanFrancisco-pm mailing list
>>>>>>> SanFrancisco-pm at pm.org
>>>>>>> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> SanFrancisco-pm mailing list
>>>>>>> SanFrancisco-pm at pm.org
>>>>>>> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm
>>>>>>
>>>>>> _______________________________________________
>>>>>> SanFrancisco-pm mailing list
>>>>>> SanFrancisco-pm at pm.org
>>>>>> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> SanFrancisco-pm mailing list
>>>> SanFrancisco-pm at pm.org
>>>> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm
>>
More information about the SanFrancisco-pm
mailing list