473,379 Members | 1,170 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Can't display certain chars in console programs

My console in WinXP is using Lucida Console for the font.

My problem is, I can go to character map and select a
string of special characters such as the following: ®¾Öþ¬«§¯
I can paste them into my console by right-clicking the
title, then edit, paste, and everything is fine.

When I try to display them on the console programmatically
by using Console.WriteLine("®¾Öþ¬«§¯"); , the console
actually displays it as r_Ö_¬«§_

As you can see, some characters were replaced by
underscores, even though they are supported in the current
font's character set.

I tried writing it with unicode codes
Console.WriteLine("\u00AE\u00BE\u00D6\u00FE\u00AC\ u00AB\u00A7\u00AF");
which resulted in the same incorrect output.

I also tried @"®¾Öþ¬«§¯" (using the @ symbol in front) with
no luck.

Anyone know how to fix this?
Nov 15 '05 #1
2 2096
My guess is that the Console class converts the string
to ASCII before printing to console and
that would account for dumping/replacing the "extended"
characters.

You might have to use the console or "Character Mode"
Win32 APIs directly.

-c

"glean" <ho***@company.com> wrote in message
news:03****************************@phx.gbl...
My console in WinXP is using Lucida Console for the font.

My problem is, I can go to character map and select a
string of special characters such as the following: ®¾Öþ¬«§¯
I can paste them into my console by right-clicking the
title, then edit, paste, and everything is fine.

When I try to display them on the console programmatically
by using Console.WriteLine("®¾Öþ¬«§¯"); , the console
actually displays it as r_Ö_¬«§_

As you can see, some characters were replaced by
underscores, even though they are supported in the current
font's character set.

I tried writing it with unicode codes
Console.WriteLine("\u00AE\u00BE\u00D6\u00FE\u00AC\ u00AB\u00A7\u00AF");
which resulted in the same incorrect output.

I also tried @"®¾Öþ¬«§¯" (using the @ symbol in front) with
no luck.

Anyone know how to fix this?
Nov 15 '05 #2
Actually, the problem is that the OEM code page is being used, while the
'ANSI' code page (or plain old Unicode) is what is probably wanted. 'ASCII'
never enters to it....
--
MichKa [MS]

This posting is provided "AS IS" with
no warranties, and confers no rights.
"Chad Myers" <cm****@N0.SP.AM.austin.rr.com> wrote in message
news:Dk******************@twister.austin.rr.com...
My guess is that the Console class converts the string
to ASCII before printing to console and
that would account for dumping/replacing the "extended"
characters.

You might have to use the console or "Character Mode"
Win32 APIs directly.

-c

"glean" <ho***@company.com> wrote in message
news:03****************************@phx.gbl...
My console in WinXP is using Lucida Console for the font.

My problem is, I can go to character map and select a
string of special characters such as the following: ®¾Öþ¬«§¯
I can paste them into my console by right-clicking the
title, then edit, paste, and everything is fine.

When I try to display them on the console programmatically
by using Console.WriteLine("®¾Öþ¬«§¯"); , the console
actually displays it as r_Ö_¬«§_

As you can see, some characters were replaced by
underscores, even though they are supported in the current
font's character set.

I tried writing it with unicode codes
Console.WriteLine("\u00AE\u00BE\u00D6\u00FE\u00AC\ u00AB\u00A7\u00AF");
which resulted in the same incorrect output.

I also tried @"®¾Öþ¬«§¯" (using the @ symbol in front) with
no luck.

Anyone know how to fix this?

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: besaar | last post by:
i got the current project that got the serial no.of a hard disk for software protection but i got an error,if u solve it send me,thanx alllllll. 1.file1 Option Strict On Option Explicit On...
20
by: Drebin | last post by:
It's a long story really, but the bottom line is we need to encrypt or obfuscate a clear-text 9-digit SSN/taxpayer ID into something less than 21 characters. It doesn't need to be super-secure,...
2
by: Brian Worth | last post by:
I have a console app that would like to reject a shutdown/restart request unless a certain condition exists. I have written programs with forms in which you can be notified when the form is about...
0
by: mhospodarsky | last post by:
Hi-- I am having trouble with bitmap images displaying. They are bitmap versions of icons. I have a program that uses these bitmap images to display at certain points specified in a layer. I...
46
by: Ian Boyd | last post by:
IIS5, on a Windows 2000 Server machine. Debeg.WriteLine "Hello, world!" How can i view it?
4
by: eglaser | last post by:
Hello, I have a script that launches a sequence of other programs, some GUI, some console. I'd like the console programs to launch in their own console window, instead of all of them sharing...
65
by: Chris Carlen | last post by:
Hi: From what I've read of OOP, I don't get it. I have also found some articles profoundly critical of OOP. I tend to relate to these articles. However, those articles were no more objective...
5
by: CC | last post by:
Hi: I'm building a hex line editor as a first real Python programming exercise. Yesterday I posted about how to print the hex bytes of a string. There are two decent options: ln =...
77
by: borophyll | last post by:
As I read it, C99 states that a byte is an: "addressable unit of data storage large enough to hold any member of the basic character set of the execution environment" (3.6) and that a byte...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.