简体   繁体   中英

Trying to output unicode latin cross character (hex : 271D) in C#

I'm trying to output the unicode latin cross character described in this chart :

http://en.wikipedia.org/wiki/List_of_Unicode_characters

So, from a winforms program, I tried this :

MessageBox.Show("Unicode latin cross character follows : \u271D");

but it shows a small box shape where the cross was expected.

Is there a safe* way to output this char ?

Note * : "Safe", meaning it will work on the average PC which has standard Windows fonts installed.

(I actually want to output this char in a SSRS report. If it can't be done in text, I'll have to use an image).

This appears to be a font problem; a small box typically indicates that. The character “✝” LATIN CROSS (U+271D) has limited coverage in fonts . None of the fonts normally shipped with Windows contains it. The Arial Unicode MS font does, but it is not part of Windows but comes with Microsoft Office (and some other products).

Consider using the widely supported “†” DAGGER (U+2020) instead, in bold face or larger size if needed an applicable.

However, there is an ugly hack that may or may not work, depending on the software used: set the font to Wingdings 2 (commonly available on Windows) and output \… or \†. This depends on the use of Wingdings 2 as a font with an 8-bit encoding. I don't expect the trick to work in most modern environments.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM