Click here to Skip to main content
15,560,618 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: The Magician's String, what you see is not what you get. Pin
Nicolas Dorier11-Aug-14 5:29
professionalNicolas Dorier11-Aug-14 5:29 
GeneralRe: The Magician's String, what you see is not what you get. Pin
Rob Grainger14-Aug-14 0:33
Rob Grainger14-Aug-14 0:33 
GeneralRe: The Magician's String, what you see is not what you get. Pin
Ian Shlasko14-Aug-14 4:46
Ian Shlasko14-Aug-14 4:46 
GeneralRe: The Magician's String, what you see is not what you get. Pin
KP Lee21-Aug-14 20:28
KP Lee21-Aug-14 20:28 
GeneralRe: The Magician's String, what you see is not what you get. Pin
Nicolas Dorier22-Aug-14 0:42
professionalNicolas Dorier22-Aug-14 0:42 
GeneralRe: The Magician's String, what you see is not what you get. Pin
KP Lee22-Aug-14 16:47
KP Lee22-Aug-14 16:47 
GeneralRe: The Magician's String, what you see is not what you get. Pin
Nicolas Dorier23-Aug-14 13:02
professionalNicolas Dorier23-Aug-14 13:02 
GeneralRe: The Magician's String, what you see is not what you get. Pin
KP Lee23-Aug-14 22:22
KP Lee23-Aug-14 22:22 
I had been taught that char supported UNICODE format and I accepted it, then I ran into the documentation that said the Length field only represented the char length. Therefore, I figured all I'd learned was wrong. Then you mentioned the hidden character and I remembered something else. I cast the char into an int. The only way it could be larger than 256 is if it was a Unicode char.

I thought for sure I could get this to blow up with more Unicode characters. By the way, you are wrong. There isn't a hidden character in the original problem. The last character in the string is an ASCII "47" character and a UNICODE "8207" character.

Your "a" code is also an ASCII and UNICODE difference, though I can't prove it without going back to your post. The last version evaluates as true.
GeneralRe: The Magician's String, what you see is not what you get. Pin
Nicolas Dorier24-Aug-14 1:02
professionalNicolas Dorier24-Aug-14 1:02 
GeneralRe: The Magician's String, what you see is not what you get. Pin
KP Lee24-Aug-14 16:28
KP Lee24-Aug-14 16:28 
GeneralRe: The Magician's String, what you see is not what you get. Pin
Nicolas Dorier25-Aug-14 2:09
professionalNicolas Dorier25-Aug-14 2:09 
GeneralRe: The Magician's String, what you see is not what you get. Pin
KP Lee23-Aug-14 23:02
KP Lee23-Aug-14 23:02 
GeneralRe: The Magician's String, what you see is not what you get. Pin
Nicolas Dorier24-Aug-14 1:05
professionalNicolas Dorier24-Aug-14 1:05 
GeneralWow, Just Wow Pin
Kevin Marois7-Aug-14 7:12
professionalKevin Marois7-Aug-14 7:12 
GeneralRe: Wow, Just Wow Pin
SoMad7-Aug-14 7:32
professionalSoMad7-Aug-14 7:32 
GeneralRe: Wow, Just Wow Pin
Vark1117-Aug-14 7:55
Vark1117-Aug-14 7:55 
GeneralRe: Wow, Just Wow Pin
Super Lloyd10-Aug-14 16:30
Super Lloyd10-Aug-14 16:30 
GeneralRe: Wow, Just Wow Pin
Ranjan.D7-Aug-14 8:10
professionalRanjan.D7-Aug-14 8:10 
GeneralRe: Wow, Just Wow Pin
DaveAuld7-Aug-14 8:24
professionalDaveAuld7-Aug-14 8:24 
GeneralRe: Wow, Just Wow Pin
KP Lee21-Aug-14 20:44
KP Lee21-Aug-14 20:44 
GeneralRe: Wow, Just Wow Pin
Pete O'Hanlon7-Aug-14 8:21
mvaPete O'Hanlon7-Aug-14 8:21 
GeneralRe: Wow, Just Wow Pin
Rob Grainger7-Aug-14 8:45
Rob Grainger7-Aug-14 8:45 
GeneralRe: Wow, Just Wow Pin
fixthebugg7-Aug-14 11:11
fixthebugg7-Aug-14 11:11 
GeneralRe: Wow, Just Wow Pin
Brisingr Aerowing7-Aug-14 15:18
professionalBrisingr Aerowing7-Aug-14 15:18 
GeneralRe: Wow, Just Wow Pin
Bernhard Hiller7-Aug-14 22:43
Bernhard Hiller7-Aug-14 22:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.