Author Topic: Need help with Java ASCII  (Read 2100 times)

0 Members and 1 Guest are viewing this topic.

Offline sayoqod

  • 25
Need help with Java ASCII
I have a project that requires me to make a program using ASCII art. I figured out that to use ASCII codes, I just declare the codes in a char variable type.

It works just fine when doing regular letters, but when I try to use special characters like ¶ and €, it only displays question marks in my output.

Is this just a problem with my computer? I thought the whole point of ASCII was that it was universal...

Any help would be appreciated :)

EDIT:

FIXED
« Last Edit: January 26, 2011, 02:20:04 pm by sayoqod »
" Twas brillig and the slithy toves/did gyre and gimble through the wabe/ all mimsy were the borogroves/ and the mome raths outgrabe"

 

Offline Iss Mneur

  • 210
  • TODO:
Re: Need help with Java ASCII
The standards body that created ASCII only standardized the first 128 characters. These lower 128 are rock-solid and supported just about everywhere, espcially for English speak countries.

The other 128 (also known as the high ASCII characters) are mapped in using code pages.  These code pages are the ones that contain the fancy characters.  Obviously, not every country or corporation or person considers the same 128 characters to be of the same importance (possibly not even the same order).

Depending on how you are outputing the characters (say NetBeans console versus the windows console) will change whether you characters will print correctly or will be converted to unknowns.  The last time I tried to do this, I had the most success with running the app in the windows console window, unfortunately the ones that are in editors are generally very simple.

Hope this helps.
"I love deadlines. I like the whooshing sound they make as they fly by." -Douglas Adams
wxLauncher 0.9.4 public beta (now with no config file editing for FRED) | wxLauncher 2.0 Request for Comments

 

Offline sayoqod

  • 25
Re: Need help with Java ASCII
Well, I did finally manage to get an email back from my teacher who, along with a few others in the IRC told me to use Unicode. So I did, as per the teacher's instructions, (we're talking copy-paste here.....), and it gave me the same thing. :/ I'm beginning to think it's (somehow) a computer problem....

But thanks :)
" Twas brillig and the slithy toves/did gyre and gimble through the wabe/ all mimsy were the borogroves/ and the mome raths outgrabe"

 

Offline Polpolion

  • The sizzle, it thinks!
  • 211
    • Minecraft
Re: Need help with Java ASCII
Well, I did finally manage to get an email back from my teacher who, along with a few others in the IRC told me to use Unicode. So I did, as per the teacher's instructions, (we're talking copy-paste here.....), and it gave me the same thing. :/ I'm beginning to think it's (somehow) a computer problem....

But thanks :)

have you tried opening the output'd textfile in word or notepad in unicode mode? If it were a computer problem you wouldn't be able to see the paragraph symbol anywhere.

 

Offline sayoqod

  • 25
Re: Need help with Java ASCII
I did, yes. Same problem.

I'm sorry, I should have been more specific about what I'd tried. My mistake. I'll edit the topic now
" Twas brillig and the slithy toves/did gyre and gimble through the wabe/ all mimsy were the borogroves/ and the mome raths outgrabe"

 

Offline sayoqod

  • 25
Re: Need help with Java ASCII
All right guys, thanks for all the help, but it turns out it really WAS just that my computer doesn't support Unicode :/
" Twas brillig and the slithy toves/did gyre and gimble through the wabe/ all mimsy were the borogroves/ and the mome raths outgrabe"