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

int unicode_wchar_to_utf16be ( uint16_t *  s,
wchar_t  wc,
size_t  size 
)

Wide character to UTF-16BE.

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

Definition at line 80 of file utf16be.c.

{
      if (wc >= 0)
      {
            if (wc < 0x010000)
            {
                  *s = big_endian_16((uint16_t) wc);
                  return 1;
            }
            if (wc < 0x200000)
            {
                  *s       = big_endian_16((uint16_t) (0xD800 + (((wc >> 16) - 1) << 6) + ((wc & 0x00FC00) >> 2)));
                  *(s + 1) = big_endian_16((uint16_t) (0xDC00 + (wc & 0x0003FF)));
                  return 2;
            }
      }
      return -EINVAL;
}


Generated by  Doxygen 1.6.0   Back to index