I wan't to concatenate some id's in C# code to export to a specific data base. The problem is that data base use a specific symbol to concatenate the id's. The symbol used is like the symbol for the gender masculine (something like this: ♂). If I try to copy here I only get the '0' character. I also try to find his ascii code but I couldn't find it. I get the symbol by exporting data from file maker pro data base. What I want is to create a array of id's concatenated by this strange symbol in C#. For example: 12[symbol]123[symbol]
-
1It's not an ASCII code but an UniCode. What goes wrong with `string m = "♂";` ? – H H Apr 30 '15 at 14:15
-
If the ids are all numerical, as in your example, you could use any character except digits. – Mr Lister Apr 30 '15 at 14:17
-
The problem is that I don't known how to write the symbol. The symbol a little different that this: ♂. The circle is smaller and the arrow is bigger. I get that symbol by export by the data base in File maker pro. – miguelbgouveia Apr 30 '15 at 14:23
2 Answers
Remember, ascii is what we used in the 1970's. You want the Unicode codepoint, not the ascii code. If you don't understand the difference then stop everything you are doing and read this before you write any more code:
http://www.joelonsoftware.com/articles/Unicode.html
The Mars symbol is the Unicode codepoint u2642, so in C# that would be
string mars = "\u2642";

- 647,829
- 179
- 1,238
- 2,067
-
You could have mentioned that if a character does have an ASCII code, it would be the same as its Unicode code. Sorry, codepoint. – Mr Lister Apr 30 '15 at 14:19
-
The symbol a little different that this: ♂. The circle is smaller and the arrow is bigger. I can copy and paste it to notepad but I can't paste it here or into any other web page. – miguelbgouveia Apr 30 '15 at 14:29
-
2@miguelbgouveia - Just past it to Visual studio. How it looks is a matter of Fonts. – H H Apr 30 '15 at 14:51
-
I just do has Henk Holterman said and is working. Still don't known the code for the symbol. If you @henk-holterman want you can reply as an answer so I can vote on it. – miguelbgouveia Apr 30 '15 at 15:09
When you have obtained the symbol in some way, just paste it into your source code:
string m = "♂";
The symbol a little different that this: ♂. The circle is smaller and the arrow is bigger
Although it's not impossible that there are 2 variations of a symbol in the Unicode space, the difference in appearance is probably due to different Fonts.
Still don't known the code for the symbol
As several people posted here, the code is 2642 and the C# notation is "Male(\u2642)"
or simply type/paste "Male(♂)"

- 263,252
- 30
- 330
- 514