[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 608
  • Last Modified:

How to insert ASCII 233 in text string?

I'm using Wingdings font and need an ASCII 233 char for an arrow. How can I represent an ASCII 233 char? Currently I have the actual ASCII 233 char in the string, but I don't like having weird characters in my strings. I think there's some simple way to specify a hex value for the character in a string.
0
deleyd
Asked:
deleyd
  • 2
  • 2
1 Solution
 
wdosanjosCommented:
Something like this:

string yourstr = "MyCharacters\u00E9AreHere";

2.4.1 Unicode character escape sequences
http://msdn.microsoft.com/en-us/library/aa664669%28v=VS.71%29.aspx
0
 
deleydAuthor Commented:
OK how about if I want an ASCII string instead of a Unicode string?
0
 
deleydAuthor Commented:
(actually I think the code text file is formatted as UTF-8)
0
 
wdosanjosCommented:
Strings in .NET are always Unicode.  How you write the file defines the character encoding.  For example:

var writer = new StreamWriter(@"C:\temp\myfile.txt", false, System.Text.Encoding.ASCII); // ASCII file

var writer = new StreamWriter(@"C:\temp\myfile.txt", false, System.Text.Encoding.UTF8); // UTF8 file

I hope this helps.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now