Support Solaris systems

Tested on SmartOS, examples all working including widechar support.