I have got confused about Unicode, UTF-16 encoding,
Java Strings and Java chars. I thought my code was wrong, then I thought not, then I was not sure.
The following code is supposed to convert any Java
String into UTF-16, where (for reasons specific to my project) each 16-bit value is a Java short, not the more usual Java char.