Mark Levison

Musings on No Touch Deployment, .NET development and photography

<November 2008>
SuMoTuWeThFrSa
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456


Navigation

Other

Blogroll

Subscriptions

Post Categories



Wednesday, September 01, 2004 - Posts

GMail Invites

With apologies for abusing my blog to do this. I have a few GMail invites to hand out, email me at mlevison at gmail

posted Wednesday, September 01, 2004 4:54 PM by mlevison with 0 Comments

Embedding Unicode Characters in a resource file (.resx)

Yesterday, I had quite a struggle trying to embed to Unicode characters in my xml resource (.resx) files. An example of what I was trying to do:

<data name="Bullet">
   <value\>\u2022\</value>
</data>

I've tried '\u2022' or 'U+2022' -- in either case when I use 'Bullet', in my code, the string is U+2022 instead of a bullet character. In the end the solution was simple run the Character Map program (Accessories -> System Tools -> Character Map), find my symbols and copy/paste them into resouce file (opened in VS .NET). Amazingly they appear as the symbols themselves and not the unicode encodings I'd expected.

An alternative approach (suggested by Stuart Celarier) is to define an Entity tag:

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE doc [ <!ENTITY oplus "?"> ] >
<doc>A ? B = B ? A</doc>

I've not taken the time to try this yet although it should work.
Hopefully this post will save some 20+ minutes of Googling. Thanks to Robi Khan for the solution.

posted Wednesday, September 01, 2004 9:47 AM by mlevison with 0 Comments




Powered by Dot Net Junkies, by Telligent Systems