> ff is defined as 0x0C, i.e. "local ff = 0x0C". There lies your problem. 0x0C is a number, not a string. When converted to a string it becomes "12" not "\f". So try ff="\f" or ff=string.char(0x0C).