Files need to be read as buffer

Remove encoding to avoid problems and use directly the buffer instead.
Also wrapped the `resdFileSync` in a try/catch in case file cannot be read.