Yesterday my colleague reported a software issue to me. I checked the application logic, but couldn’t find any clue. However, because the software hasn’t been touched for a long time and has passed the testing in the last release, I decided to focus on the manually constructed configuration file, which is of yaml format and is error-prone. I used the below command to check the ASCII and hexadecimal representation of the configuration file.
od -t a -t x1 file-name
After inspecting the content of the file, I found that the yaml configuration file seemed to be correctly aligned, but it didn’t. Some obscure invisible characters instead of white spaces, maybe Chinese white spaces, were used to align the yaml content. This caused the application failed to parse the configuration file.
Linux od command is a convenient tool to inspect the internal representation of small files. I posted it here for further reference.