UTF-16 endianess

Marek Janukowicz via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jan 30 15:37:07 PST 2016


On Fri, 29 Jan 2016 18:58:17 -0500, Steven Schveighoffer wrote:
>>> Note the version identifiers BigEndian and LittleEndian can be used to
>>> compile the correct code.
>>
>> This solution is of no use to me as I don't want to change the endianess in
>> general.
>
> What I mean is that you can annotate your code with version statements like:
>
> version(LittleEndian)
> {
>     // perform the byteswap
>     ...
> }
>
> so your code is portable to BigEndian systems (where you would not want 
> to byte swap).

That's a good point, thanks.

-- 
Marek Janukowicz


More information about the Digitalmars-d-learn mailing list