Detect UTF-16 byte order at compile time

Detect UTF-16 byte order at compile time rather than run time if possible.