Fix clipboard device code so it works identically under non-wide-char platforms

This contribution was originally written by Richard Smolak.
Merge pull request #94 from ladislav/clipboard

Fix clipboard device code so it works identically under non-wide-char platforms