PDFdev is a service provided by PDFzone.com | http://www.pdfzone.com
_____________________________________________________________

This appears to work. However, there must be a smarter way to do this

// parses four characters into one wchar unicode character
wchar_t ParseHex(char *input)
{
   char *digits = "0123456789ABCDEF";
   //char input[5] = "9DDF";

   /* Read 4 characters of hex encoded unicode and convert them to
uppercase. */
   
if (islower(input[0]))
   input[0] = toupper(input[0]);
if (islower(input[1]))
   input[1] = toupper(input[1]);
if (islower(input[2]))
   input[2] = toupper(input[2]);
if (islower(input[3]))
   input[3] = toupper(input[3]);
      

   /* Convert from hex to wchar_t */
   return (4096 * (strchr(digits, input[0]) - strchr(digits, '0'))
        + 256 * (strchr(digits, input[1]) - strchr(digits, '0'))
      + 16 * (strchr(digits, input[2]) - strchr(digits, '0'))
      + (strchr(digits, input[3]) - strchr(digits, '0'))

    );
}


To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfdev.html

Reply via email to