Which is equivalent to chr (153) (TM SYMBOL) in Unicode

In earlier versions of Delphi, I could use

s:=chr(153); 

to get the brand symbol in the string. In Delphi 2010, this no longer works, possibly with unicode. What equivalent line of code puts the TM character in my line?

+7
unicode delphi ascii
source share
6 answers

I am sure that chr(153) is β€œΓ–β€ (Page Code 437 ), oh wait, this is β€œr” ( EBCDIC 037 ).

In fact, chr(153) is undefined unless you also specify the codepage used.
That is why you should use Unicode .

Wikipedia has pages for most Unicode characters and includes a Unicode codepoint for them.

There is a regular trademark symbol character with the unicode code number U + 2122 (Delphi: Chr($2122) or #$2122 ).
There is also a registered trademark symbol with the unicode code U + 00AE (Delphi: Chr($00AE) or #$00AE ).

The unicode site contains a list of diagrams where you can find all the symbols, but it takes time to get used to finding them (since the number of diagrams is a little large).
A simple trademark symbol is part of the letter symbols .
The registered trademark is part of the Latin-1 supplement .

- Jeroen

+9
source share

In D2010, I can do this:

 s := 'β„’' + chr(8482) + #8482; // yields 3 subsequent TM symbols 

Result: β„’ people

This is a good article, Joel himself - I will re-read it only today, in fact. http://www.joelonsoftware.com/articles/Unicode.html

+11
source share

According to the Unicode code diagram for alphabetic characters , the TM character is Unicode U + 2122. I don’t know enough Delphi to find out how you turn it into a character - maybe

 s := chr(8482); 

? (8482 is the decimal value for hexadecimal 2122.)

Alternatively, by looking at this page , you can try:

 s := #$2122; 
+3
source share

U + 2122 symbol ( http://www.fileformat.info/info/unicode/char/2122/index.htm ). I have not used Delphi for a long time, but first of all you should try to enter the character directly (possibly using the Character Map utility, such as Windows charmap.exe or BabelMap). It is easier to read than anything else.

+1
source share

To find out the Unicode encoding code for a given character, open "Accessories" β†’ "Utilities" β†’ "Character Map", select the Unicode font, find the character you need, in the lower left corner the application will display the Unicode code.

0
source share

in html it & # x2122 try using it on http://code.cside.com/3rdpage/us/unicode/converter.html

-one
source share

All Articles