wood burning stoves*
The moose likes Cattle Drive and the fly likes Unreadable code ?! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Unreadable code ?!" Watch "Unreadable code ?!" New topic
Author

Unreadable code ?!

Michael Matola
whippersnapper
Ranch Hand

Joined: Mar 25, 2001
Posts: 1746
    
    2
Pauline McNamara
Sheriff

Joined: Jan 19, 2001
Posts: 4012
    
    6
Yet unreadabler maybe...
Michael Matola
whippersnapper
Ranch Hand

Joined: Mar 25, 2001
Posts: 1746
    
    2
Unreadablest.java:
Michael Matola
whippersnapper
Ranch Hand

Joined: Mar 25, 2001
Posts: 1746
    
    2
Ok, I'll admit that it took me awhile to sort out MessageBack. I was able to read your message in the end (three cheers for crypticism!), but not as Java output.
So I'd like to know -- were *you* able to read the output from Java? And if so, how?
I just got ???s for the Unicode characters -- because I don't have a Unicode font that covers Burmese. :roll: (You do realize that the 1000 range is Myanmar/Burmese and that quite a few of the characters you displayed are reserved but unused? So even if you *do* have Burmese, some of the stuff wouldn't display a character anyhow.)
Anyhow, at some point I realized the 1000 range is also how you can do Cyrillic as HTML entities. (IS0 8879ish, right? Definitely not Unicode.) So I ripped out the codes and put some html around them and changed \uXXXX to &#XXXX; and whatnot and found some, er, um, interesting "Russian."
What fun!
(And I didn't even mention "snowboarding" in any of this...)
jason adam
Chicken Farmer ()
Ranch Hand

Joined: May 08, 2001
Posts: 1932
And for some reason I agreed to help moderate this forum!?
Pauline McNamara
Sheriff

Joined: Jan 19, 2001
Posts: 4012
    
    6
Who let him in here?
Anyway, after a lot of sweating on my part and I got unreadablest in a readable state. I don't think I'm ready to start a career as a secret service code buster though, Cattle Drive cryptic is more than enough for me!
So I'd like to know -- were *you* able to read the output from Java? And if so, how?
No, I got ???s too - assuming I had the Unicode right, I just figured my fonts didn't cover it, but that if anyone had *those* fonts, Michael Matola would. So I sent you off on a wild goose chase without even knowing it, he he, lucky for me you're so persistent! (Guess the automatic converter page I used wasn't the right one, alas.)
I got unreadablest to print out in java - in little chunks only. Java choked at the \u0022 character. Now I ask you: could you print out the whole of unreadablest.java as a String in java?
I'll admit too that I was really duped by the first output I got, even though it wasn't complete. Of course I'd named my file unreadablest.java and when I ran it, it looked likt it was spitting itself back to me - wha?!?! Touch´┐Ż!
My encounters with text encoding usually leave me with a few bald patches on my head - this one got me some big smiles too. (It's OK, the hair will grow back... )
So, lots of time 'til 2/25 rolls around...
[ March 13, 2004: Message edited by: Pauline McNamara ]
Michael Matola
whippersnapper
Ranch Hand

Joined: Mar 25, 2001
Posts: 1746
    
    2
MPcN: Who let him in here?
Yeah, I thought Jason was busy this winter skiing and abusing snowboarders. Betcha he wears a flourescent romper.
PMcN: Anyway, after a lot of sweating on my part and I got unreadablest in a readable state.
But you realize that you didn't have to mess with it at all in order to read my "secret message"? The gobbledygook above is compilable Java source code. All you have to do is cut and paste it into a text editor, save it as "Unreadablest.java", compile it, and run. Worked fine for me both under Windows and Unix. Don't have easy access to a Mac.
(See, I even gave you the file name so you *wouldn't* have to decode the Unicode escapes to find out what I named the class. The ".java" was a hint that it was Java source.)
(As an aside, I've found that cutting works best in UBB if you open the post as if you're going to respond to it and cut the code from the editing window, instead of just cutting from the HTML page.)
So I sent you off on a wild goose chase without even knowing it, he he, lucky for me you're so persistent!
Yep. Just wouldn't let this one get the best of me.
Guess the automatic converter page I used wasn't the right one, alas.
Yeah, next time find a *Unicode* converter page instead of an HTML entity converter page.
I got unreadablest to print out in java - in little chunks only. Java choked at the \u0022 character.
What were you trying to do? Read the above source as regular text or just compile and run it? If you want to read it as regular text, I guess you'd have to replace all the Unicode escapes with their character equivalent. (Which is just the reverse of what I did to get it into that state.) As far as compiling it and running it, I mentioned above the simplest way of doing that.
Now regarding the \u0022 character -- those are quotes. Java doesn't like anything inside quotes to be split across lines. I could have provide the source as one long unbroken line, but I decide to break it up into multiple lines so it wouldn't distort the HTML page too much. The trick was putting the line breaks in places where it wouldn't disrupt quoted strings. That's one of the reasons I used both a System.out.print and System.out.println. Having even just that short message in one System.out.println caused the line to be way long.
Now I ask you: could you print out the whole of unreadablest.java as a String in java?
Oh, wait. I think I see. You were trying to take my code as a text file and write a Java program to print it out, right? Or did you paste my code into a Java program and try to System.out.println it? I never tried either of those. That's how I guess you'd run into problems with quotes. The quotes in my original would then become embedded in your quotes and would have to be escaped. So you'd have to replace my \u022 with \" (or whatever the Unicode is for that).
Sounds like you had a nice wild goose chase of your own!
My encounters with text encoding usually leave me with a few bald patches on my head.
I usually find myself clutching my eyeballs.
Pauline McNamara
Sheriff

Joined: Jan 19, 2001
Posts: 4012
    
    6
All you have to do is cut and paste it into a text editor, save it as "Unreadablest.java", compile it, and run. Worked fine for me both under Windows and Unix. Don't have easy access to a Mac.
Well, why didn't you say so? Works fine on a Mac too, even copying directly from the html page.
Yeah, next time find a *Unicode* converter page instead of an HTML entity converter page.
I thought for sure it was, but then it was probably too late at night to keep those details straight.
Or did you paste my code into a Java program and try to System.out.println it?
Bingo. Why do things the easy way?
Sounds like you had a nice wild goose chase of your own!
Mm hmm. Didn't spot any fluorescent rompers, though, will have to keep an eye out for those odd birds.
jason adam
Chicken Farmer ()
Ranch Hand

Joined: May 08, 2001
Posts: 1932
Originally posted by Michael Matola:
MPcN: Who let him in here?
Yeah, I thought Jason was busy this winter skiing and abusing snowboarders. Betcha he wears a flourescent romper.

What's wrong with the romper?
And no, I have a very sensible pant and coat suit... very red, very bright, but very sensible.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unreadable code ?!