Logo Search packages:      
Sourcecode: fuse-umfuse-fat version File versions  Download package

int unicode_utf16be_to_wchar ( wchar_t *restrict  result,
const uint16_t *restrict  string,
size_t  size 
)

UTF-16BE to wide character.

Remarks:
This is the big endian version of unicode_utf16le_to_wchar()

Definition at line 57 of file utf16be.c.

{
      uint16_t v;
      if (!size) return -ENAMETOOLONG;
      v = big_endian_16(*string);
      if ((v & 0xFC00) != 0xD800)
      {
            *result = (wchar_t) v;
            return 1;
      }
      if (size < 2) return -ENAMETOOLONG;
      *result = ((v & 0x03FF) << 10) + 0x010000;
      v = big_endian_16(*(++string));
      if ((v & 0xFC00) != 0xDC00) return -EILSEQ;
      *result |= v & 0x03FF;
      return 2;
}


Generated by  Doxygen 1.6.0   Back to index