RouteX Document Router Toolkit
Main Functions Types & Errors Query Language Demo Home

rxHexToChar

Converts a hex "character" to a regular ASCII character. Note that this only converts the two byte character to ASCII. It does not convert an entire word to ASCII. You are also responsible to skip the leading "0x" designating hexadecimal strings. The string passed to rxHexToChar for the hex character must be at least two bytes long. Extra bytes are simply ignored. You do not need to null terminate the string.

Use this if you wish to display a query that was stored in RouteX. Since RouteX stores these in hexadecimal form for flexibility you should convert them before displaying them for your users. The easier way of doing this if you need to display your queries is simply to store the ASCII form in the reference field.

In general there are few reasons to call this function, but it is provided for your use if needed.

Synopsis

void rxHexToChar( UCharT *C, UCharT *Hex )

Arguments

C The ASCII character translated to.
Hex A two byte string

Returns

Nothing.

Related Functions

rxConvertQuery, rxHexToChar, rxAddQuery

Example


int MakeASCIIWord( char *hex, char *word) {



   char  *hloc = hex;

   char  *wloc = word; 



   // first make sure it actually is a hex string

   if( !memcmp( hloc, "0x", 2) ) {

      // not a hex string

      return -1;

   }



   hloc += 2;  // skip hex prefix



   while( isdigit( *hloc ) ) {



      rxHexToChar( *wloc, *hloc );



      hloc += 2;

      wloc++;

   }

 

   *wloc = 0;  // null terminate our ascii word

}

 

Previous Main Next Home

Copyright 2000 Lextek International