* Changes to work on UTF-8 mbstring configured systems

* Explicitly setting string-based functions encoding to ASCII so that library continues to work on systems configured to use an encoding like UTF-8
* Additional socket error handling to avoid fatal errors