David-Sarah Hopwood wrote:
> Ian Eyberg wrote:
>> if ( (contents[0] == (byte)0xFF) && (contents[1] == (byte)0xFE) ) {
>
> You probably want to accept little-endian UTF-16 (as sometimes produced
> by Windows systems) here, given that it's very easy to do:
Correction: you probably want to also accept big-endian UTF-16. Your
code above was detecting only little-endian.
> if ( (contents[0] == (byte)0xFF && contents[1] == (byte)0xFE) ||
> (contents[0] == (byte)0xFE && contents[1] == (byte)0xFF) ) {
--
David-Sarah Hopwood ⚥ http://davidsarah.livejournal.com
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---