home *** CD-ROM | disk | FTP | other *** search
- #include <wfc.h>
- #pragma hdrstop
-
- /*
- ** Author: Samuel R. Blackburn
- ** CI$: 76300,326
- ** Internet: sammy@sed.csc.com
- **
- ** You can use it any way you like.
- */
-
- #if defined( _DEBUG )
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- void ASCII_to_UNICODE( LPCSTR ansi_string, LPWSTR unicode_string )
- {
- if ( ansi_string == NULL || unicode_string == NULL )
- {
- return;
- }
-
- int index = 0;
-
- while( ansi_string[ index ] != 0x00 )
- {
- unicode_string[ index ] = ansi_string[ index ];
- index++;
- }
-
- unicode_string[ index ] = 0;
- }
-
- void UNICODE_to_ASCII( LPCWSTR unicode_string, LPSTR ansi_string )
- {
- if ( unicode_string == (LPCWSTR) NULL || ansi_string == (LPSTR) NULL )
- {
- return;
- }
-
- int index = 0;
-
- while( unicode_string[ index ] != 0 )
- {
- if ( unicode_string[ index ] < 256 )
- {
- ansi_string[ index ] = (char) unicode_string[ index ];
- }
- else
- {
- ansi_string[ index ] = ' ';
- }
-
- index++;
- }
-
- ansi_string[ index ] = 0x00;
- }
-