Click here to Skip to main content
15,885,038 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
Ian Shlasko14-Aug-14 3:46
Ian Shlasko14-Aug-14 3:46 
GeneralRe: The Magician's String, what you see is not what you get. Pin
KP Lee21-Aug-14 19:28
KP Lee21-Aug-14 19:28 
GeneralRe: The Magician's String, what you see is not what you get. Pin
Nicolas Dorier21-Aug-14 23:42
professionalNicolas Dorier21-Aug-14 23:42 
GeneralRe: The Magician's String, what you see is not what you get. Pin
KP Lee22-Aug-14 15:47
KP Lee22-Aug-14 15:47 
GeneralRe: The Magician's String, what you see is not what you get. Pin
Nicolas Dorier23-Aug-14 12:02
professionalNicolas Dorier23-Aug-14 12:02 
GeneralRe: The Magician's String, what you see is not what you get. Pin
KP Lee23-Aug-14 21:22
KP Lee23-Aug-14 21:22 
GeneralRe: The Magician's String, what you see is not what you get. Pin
Nicolas Dorier24-Aug-14 0:02
professionalNicolas Dorier24-Aug-14 0:02 
GeneralRe: The Magician's String, what you see is not what you get. Pin
KP Lee24-Aug-14 15:28
KP Lee24-Aug-14 15:28 
Nicolas Dorier wrote:
Unicode 8207 was not the '/', that's the reason why the two length were not the same.
The Unicode character system is a set of bits that when cobbled together become the symbol of a character that is represented. Another way a set of bits can be cobbled together become the symbol of a character. In the same way, a Unicode character can be represented as a number. However that character can reach into the millions as a number.

In order to represent a character or number on the screen a graphical image must be displayed. That means it has to have software that when given the number displays the right graphical image. An ASCII character MUST be one byte long, no more, no less. IE it requires 8 bits to represent a character. In ASCII, a zero is equivalent to SQL's NULL and isn't a character, so ASCII can only have 255 characters. I don't believe the ASCII set of defined characters has a length of 255 in it. So, depending on the software, the image displayed can change between the devices. Unicode is a character that uses at least 2 bytes and up to 4 bytes, which means it could have a character set that is 4 billion characters long.

We're nowhere near that level, like I said, I believe the length is around a million. As far as "a" is concerned, this is an ASCII character and a Unicode character, there isn't a hidden character involved. One uses one byte and one uses two bytes. The application software supports enough graphical design to support both versions of "a" and I believe because of that it only counts the length as 1 even though it is using two bytes because it is accounted for in software.

The 8207 is the character that has a graphical image of "/" in some software, but when it runs in code it looks exactly like the special 'a' character using Console.WriteLine. It isn't a hidden character, both times it re-reads 8207, so both times it reads the exact same location twice. It's a screw-up in how it counts so even the left/right arrows read the same location twice. In that respect, yes, it is a hidden character.
GeneralRe: The Magician's String, what you see is not what you get. Pin
Nicolas Dorier25-Aug-14 1:09
professionalNicolas Dorier25-Aug-14 1:09 
GeneralRe: The Magician's String, what you see is not what you get. Pin
KP Lee23-Aug-14 22:02
KP Lee23-Aug-14 22:02 
GeneralRe: The Magician's String, what you see is not what you get. Pin
Nicolas Dorier24-Aug-14 0:05
professionalNicolas Dorier24-Aug-14 0:05 
GeneralWow, Just Wow PinPopular
Kevin Marois7-Aug-14 6:12
professionalKevin Marois7-Aug-14 6:12 
GeneralRe: Wow, Just Wow PinPopular
SoMad7-Aug-14 6:32
professionalSoMad7-Aug-14 6:32 
GeneralRe: Wow, Just Wow Pin
Vark1117-Aug-14 6:55
Vark1117-Aug-14 6:55 
GeneralRe: Wow, Just Wow Pin
Super Lloyd10-Aug-14 15:30
Super Lloyd10-Aug-14 15:30 
GeneralRe: Wow, Just Wow Pin
Ranjan.D7-Aug-14 7:10
professionalRanjan.D7-Aug-14 7:10 
GeneralRe: Wow, Just Wow Pin
DaveAuld7-Aug-14 7:24
professionalDaveAuld7-Aug-14 7:24 
GeneralRe: Wow, Just Wow Pin
KP Lee21-Aug-14 19:44
KP Lee21-Aug-14 19:44 
GeneralRe: Wow, Just Wow Pin
Pete O'Hanlon7-Aug-14 7:21
mvePete O'Hanlon7-Aug-14 7:21 
GeneralRe: Wow, Just Wow Pin
Rob Grainger7-Aug-14 7:45
Rob Grainger7-Aug-14 7:45 
GeneralRe: Wow, Just Wow Pin
fixthebugg7-Aug-14 10:11
fixthebugg7-Aug-14 10:11 
GeneralRe: Wow, Just Wow Pin
Brisingr Aerowing7-Aug-14 14:18
professionalBrisingr Aerowing7-Aug-14 14:18 
GeneralRe: Wow, Just Wow Pin
Bernhard Hiller7-Aug-14 21:43
Bernhard Hiller7-Aug-14 21:43 
AnswerRe: Wow, Just Wow Pin
Ravi Bhavnani10-Aug-14 10:53
professionalRavi Bhavnani10-Aug-14 10:53 
GeneralRe: Wow, Just Wow Pin
Marc Koutzarov29-Aug-14 21:48
professionalMarc Koutzarov29-Aug-14 21:48 

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.