Handle encoding errors while using the remote connection on "Windows Os".

Closes #249.