Code & Clay – Notes to self. Mainly Ruby/Rails.

Unicode null

Unicode has a character that represents null.

It is used to represent the end of a string but could also be used when a placeholder character is required. Perhaps as padding, differentiating from ' '.

In Ruby, 0.chr evaluates to the Null character.

There is a can of worms called Null Byte Injection associated with this character.