format characters and variables