dragon4spy Posted February 15, 2004 Posted February 15, 2004 Hi there! :) Since ASCI character is 8 bits long, and Unicode chracter is 16 bits long. Is there any special bit in a string that make it unicode or asci? :D How to display unicode string in vb.net program? How to convert unicode string to asci and vice-visa? Quote Don't judge a man by his look. Don't judge a book by its cover. :D
Administrators PlausiblyDamp Posted February 15, 2004 Administrators Posted February 15, 2004 ASCII is actually only 7 bits long, ANSI is 8 bits. Under .Net all strings are treated as unicode anyway so nothing special is needed to display them. As for converting between them have a look under the System.Text namespace - lots of stuff under there Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
caeanis Posted December 17, 2007 Posted December 17, 2007 This is not quite as easy as it sounds. I've been looking all night via the net for how to get a vulgar fraction to display, whether on the console or in a messagebox or written to an xml file (which is ultimately what I'm trying to do.) I find that no matter what I try I get the square symbol that the system prints when it doesn't know how to generate the character. I am looking for info for system.text but I haven't seen anything that will allow me to preserve the character I want to display. Quote
Administrators PlausiblyDamp Posted December 17, 2007 Administrators Posted December 17, 2007 It might help if you showed what code you have so far - displaying 1/4 (U+00BC) works fine in a messagebox and to the console here (are you using a font that does support this character?) without any problems. As far as writing out to any type of text file (xml or otherwise) then make sure you are using an encoding that is Unicode. Also for xml files ensure the declaration agrees with the encoding type used as differences between them can cause problems. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.