00001 /*++ 00002 00003 Copyright (c) 1989 Microsoft Corporation 00004 00005 Module Name: 00006 00007 nlssup.c 00008 00009 Abstract: 00010 00011 This module defines CPU specific routines for converting NLS strings. 00012 00013 Author: 00014 00015 Steve Wood (stevewo) 31-Mar-1989 00016 00017 Revision History: 00018 00019 00020 --*/ 00021 00022 #include "ntrtlp.h" 00023 00024 WCHAR 00025 RtlAnsiCharToUnicodeChar( 00026 IN OUT PCHAR *SourceCharacter 00027 ) 00028 00029 /*++ 00030 00031 Routine Description: 00032 00033 This function translates the specified ansi character to unicode and 00034 returns the unicode value. The purpose for this routine is to allow 00035 for character by character ansi to unicode translation. The 00036 translation is done with respect to the current system locale 00037 information. 00038 00039 00040 Arguments: 00041 00042 SourceCharacter - Supplies a pointer to an ansi character pointer. 00043 Through two levels of indirection, this supplies an ansi 00044 character that is to be translated to unicode. After 00045 translation, the ansi character pointer is modified to point to 00046 the next character to be converted. This is done to allow for 00047 dbcs ansi characters. 00048 00049 Return Value: 00050 00051 Returns the unicode equivalent of the specified ansi character. 00052 00053 --*/ 00054 00055 { 00056 WCHAR UnicodeCharacter; 00057 00058 // 00059 // Note that this needs to reference the translation table ! 00060 // 00061 00062 UnicodeCharacter = **SourceCharacter; 00063 (*SourceCharacter)++; 00064 return UnicodeCharacter; 00065 } 00066 00067 00068 VOID 00069 RtlpAnsiPszToUnicodePsz( 00070 IN PCHAR AnsiString, 00071 IN WCHAR *UnicodeString, 00072 IN USHORT AnsiStringLength 00073 ) 00074 00075 /*++ 00076 00077 Routine Description: 00078 00079 This function translates the specified ansi character to unicode and 00080 returns the unicode value. The purpose for this routine is to allow 00081 for character by character ansi to unicode translation. The 00082 translation is done with respect to the current system locale 00083 information. 00084 00085 00086 Arguments: 00087 00088 AnsiString - Supplies a pointer to the ANSI string to convert to unicode. 00089 UnicodeString - Supplies a pointer to a buffer to hold the unicode string 00090 AnsiStringLength - Supplies the length of the ANSI string. 00091 00092 Return Value: 00093 00094 None. 00095 00096 --*/ 00097 00098 { 00099 ULONG Index; 00100 PCHAR AnsiChar; 00101 00102 AnsiChar = AnsiString; 00103 Index = 0; 00104 while(Index < AnsiStringLength ) { 00105 UnicodeString[Index] = RtlAnsiCharToUnicodeChar(&AnsiChar); 00106 Index++; 00107 } 00108 UnicodeString[Index] = UNICODE_NULL; 00109 }