网站首页  词典首页

请输入您要查询的函数:

 

术语 lcmapstring
释义 LCMapString
语法:
int LCMapString(
__in LCID Locale,
__in DWORD dwMapFlags,
__in LPCTSTR lpSrcStr,
__in int cchSrc,
__out LPTSTR lpDestStr,
__in int cchDest
);
LCMapString功能
对于由标识符指定的区域设置,地图,一个输入到另一个字符串使用指定的转型,或者生成一个输入字符串排序的关键。
注意:对于互操作性的原因,应用程序应更喜欢LCMapStringEx功能LCMapString,因为微软是对的,而不是新的区域设置的区域设置标识符地区名称的使用迁移。这一建议特别适用于自定义语言环境,包括微软创建的。任何将只运行在Windows Vista和以后应使用LCMapStringEx申请。
参数
区域设置 [in]
区域设置标识符指定的语言环境。您可以使用MAKELCID宏创建一个区域设置标识符或使用下列预定义的值之一。
LOCALE_INVARIANT
LOCALE_SYSTEM_DEFAULT
LOCALE_USER_DEFAULT
下面的自定义区域设置标识符也支持。
LOCALE_CUSTOM_DEFAULT
LOCALE_CUSTOM_UI_DEFAULT
LOCALE_CUSTOM_UNSPECIFIED
dwMapFlags [in]
旗指定类型的转变过程中使用的字符串映射或排序键生成的类型。此参数可以有以下值。
FlagMeaning
LCMAP_BYTEREVUse字节逆转。例如,如果应用程序通过,其结果是0x5034 0x2248在0x3450 0x4822。
LCMAP_FULLWIDTHUse Unicode(宽)字符如适用。这个标志和LCMAP_HALFWIDTH是并行不悖的。
LCMAP_HALFWIDTHUse狭窄的字符如适用。这个标志和LCMAP_FULLWIDTH是并行不悖的。
LCMAP_HIRAGANAMap所有的平假名片假名字符。这个标志和LCMAP_KATAKANA是并行不悖的。
LCMAP_KATAKANAMap所有平假名片假名字符。这个标志和LCMAP_HIRAGANA是并行不悖的。
LCMAP_LINGUISTIC_CASINGUse语言规则的外壳,而不是文件系统的规则(默认)。这个标志是有效的LCMAP_LOWERCASE或LCMAP_UPPERCASE只。
LCMAP_LOWERCASEFor区域设置和脚本的大写和小写处理能力,地图的所有字符为小写。
LCMAP_SIMPLIFIED_CHINESEMap传统汉字简体字。这个标志和LCMAP_TRADITIONAL_CHINESE是并行不悖的。
LCMAP_SORTKEYProduce规范化排序键。如果LCMAP_SORTKEY标志没有被指定的函数执行字符串映射。对于这类密钥生成和字符串映射的细节请参见备注部分。
LCMAP_TITLECASEWindows 7:地图中的所有字符所有权的情况,其中每个主要单词首字母大写。
LCMAP_TRADITIONAL_CHINESEMap简化为繁体字中文字符。这个标志和LCMAP_SIMPLIFIED_CHINESE是并行不悖的。
LCMAP_UPPERCASEFor区域设置和脚本的大写和小写处理能力,地图的所有字符大写。
以下标志可单独使用,配合,或与LCMAP_SORTKEY和/或LCMAP_BYTEREV标志。但是,他们不能结合上面列出的其他标志。
FlagMeaning
NORM_IGNORENONSPACEIgnore nonspacing字符。对于(特别是拉丁语系)许多脚本,NORM_IGNORENONSPACE恰逢LINGUISTIC_IGNOREDIACRITIC。
注意NORM_IGNORENONSPACE忽略任何次要的区别,无论是读音符号与否。韩国,日本,中国和印度语言脚本,除其他外,用于其他目的而变音符号这种区别。 LINGUISTIC_IGNOREDIACRITIC导致函数忽略只有实际发音符号,而不是无视第二排序的重量。
NORM_IGNORESYMBOLSIgnore符号和标点符号。
下面列出的标志只用于与LCMAP_SORTKEY标志。
FlagMeaning
LINGUISTIC_IGNORECASEIgnore情况下,适当的语言。
LINGUISTIC_IGNOREDIACRITICIgnore nonspacing字符,语言恰当的。
注意:此标志并不总是产生预期的效果时使用的字符分解,即字符,其中一个基本字符和一个或多个nonspacing字符各有不同的码点值。
NORM_IGNORECASEIgnore情况。对于(特别是拉丁语系)许多脚本,NORM_IGNORECASE恰逢LINGUISTIC_IGNORECASE。
注意NORM_IGNORECASE忽略任何高等教育的区别,无论是语言的情况,其实不是。例如,在阿拉伯语和印度语脚本,此标志区分字符的替代形式,但差异不符合语言的情况。 LINGUISTIC_IGNORECASE导致函数忽略实际语言只是外壳,而不是无视第三排序的重量。
对于双字节字符集的说明(DBCS)的语言环境,NORM_IGNORECASE,但对所有Unicode字符以及窄(单字节)字符,其中包括效力希腊和西里尔字母。
NORM_IGNOREKANATYPEDo不区分平假名和片假名字符。相应的平假名和片假名字符比较平等。
NORM_IGNOREWIDTHIgnore例如之间的半宽度和全角字符的差异,C的==猫。全宽形式是格式区分中文和日文脚本。
NORM_LINGUISTIC_CASINGUse语言规则的外壳,而不是文件系统的规则(默认)。生成排序关键字,这个标志是不相关的。对NORM_LINGUISTIC_CASING使用也有类似的效果。
SORT_DIGITSASNUMBERSWindows 7:治疗期间,以数字排序数字,例如,类似“2”之前的“10”。
SORT_STRINGSORTTreat标点符号作为符号相同。
lpSrcStr [in]
指针源字符串的函数映射或使用排序密钥生成。此字符串不能有一个大小为0。
cchSrc [in]
大小,这表明在字符,源字符串lpSrcStr。源字符串的大小可以包括终止空字符,但没有通过。如果终止空字符包括在内,则函数的映射行为影响不大,因为终止空字符被认为是unsortable,始终对自己的地图。
应用程序可以设置参数的任何负值,指定源字符串是空终止。在这种情况下,如果LCMapString正在使用中的字符串映射模式下,函数计算字符串的长度本身,空终止映射字符串lpDestStr表示。
应用程序不能设置为0参数。
lpDestStr [out]
可选。缓冲区指针在本函数检索映射字符串或排序的关键。当应用程序使用此函数来生成一个排序键,目标字符串可以包含一个字节奇数。在LCMAP_BYTEREV标志只扭转了偶数字节。最后一个字节(奇数位置的排序键)不扭转。
注意:目标字符串可以作为只有LCMAP_UPPERCASE或LCMAP_LOWERCASE设置源字符串相同。否则,该字符串可以不一样。如果是,该功能失败。
注意:在完成功能衰竭,目标缓冲区可能包含任何部分结果或没有结果的。在这种情况下,建议您的应用程序,考虑任何结果无效。
cchDest [in]
大小,这表明在字符,在目标字符串lpDestStr。如果应用程序使用的字符串映射的功能,它提供了此参数的字符数。如果一终止空字符的空间正在cchSrc包括cchDest还必须包括一个终止空字符的空间。
如果应用程序正在使用的函数生成一个排序键,它提供了大小字节数。这字节数必须包括排序键0x00终止空间。
应用程序可以设置cchDest为0。在这种情况下,该函数不使用lpDestStr参数并返回映射的字符串或排序键所需的缓冲区大小。
返回值
在翻译返回字符串或排序关键字的字符或字节数,包括终止空字符,如果成功的话。如果函数成功与cchDest值为0,返回值是须持有的翻译字符串或排序键,其中包括终止空字符缓冲区的大小。
这个函数返回0,如果没有成功。为了获得更多错误信息,应用程序可以调用GetLastError函数,可以返回以下错误代码之一:
ERROR_INSUFFICIENT_BUFFER。阿提供的缓冲区大小不够大,或者被错误地设置为NULL。
ERROR_INVALID_FLAGS。旗帜提供的值不是有效的。
ERROR_INVALID_PARAMETER。该参数值的任何无效。
备注
应用程序可以使用LCMapString或LCMapStringEx生成排序关键字。要做到这一点,应用程序指定了dwMapFlags参数LCMAP_SORTKEY。有关更多信息,请参见处理您的应用程序进行排序。
另一个应用程序的使用方法LCMapString或LCMapStringEx是映射字符串。在这种情况下,应用程序不指定为dwMapFlags参数LCMAP_SORTKEY,但是供应其他一些标志的组合。有关更多信息,请参见处理您的应用程序进行排序。
从Windows Vista开始,这个功能可以处理自定义区域设置的数据。数据不能保证从同一计算机到计算机之间或应用程序的运行。如果应用程序必须坚持或传输数据,请参阅使用持久性本地化数据。
地图的LCMapString字符串与Unicode的默认的Windows(ANSI)的基础代码页指定的语言环境相关的ANSI版本。当此函数的ANSI版本是使用Unicode的唯一区域,函数可以成功,因为操作系统使用CP_ACP价值,代表系统默认的Windows ANSI代码页。然而,在字符系统代码页未定义出现在一个字符串问号(?)。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinnls.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesLCMapStringW(Unicode)和LCMapStringA(ANSI)的
参见
国家语言支持
国家语言支持功能
在应用程序中处理排序
CompareString
FindNLSString
GetNLSVersion
LCMapStringEx
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月12号
==英文原文==LCMapString Function
For a locale specified by identifier, maps one input character string to another using a specified transformation, or generates a sort key for the input string.
Note For interoperability reasons, the application should prefer the LCMapStringEx function to LCMapString because Microsoft is migrating toward the use of locale names instead of locale identifiers for new locales. This recommendation applies especially to custom locales, including those created by Microsoft. Any application that will be run only on Windows Vista and later should use LCMapStringEx .
Syntax
int LCMapString(
__in LCID Locale,
__in DWORD dwMapFlags,
__in LPCTSTR lpSrcStr,
__in int cchSrc,
__out LPTSTR lpDestStr,
__in int cchDest
);
Parameters
Locale [in]
Locale identifier that specifies the locale. You can use the MAKELCID macro to create a locale identifier or use one of the following predefined values.
LOCALE_INVARIANT
LOCALE_SYSTEM_DEFAULT
LOCALE_USER_DEFAULT
The following custom locale identifiers are also supported.
LOCALE_CUSTOM_DEFAULT
LOCALE_CUSTOM_UI_DEFAULT
LOCALE_CUSTOM_UNSPECIFIED
dwMapFlags [in]
Flags specifying the type of transformation to use during string mapping or the type of sort key to generate. This parameter can have the following values.
FlagMeaning
LCMAP_BYTEREVUse byte reversal. For example, if the application passes in 0x3450 0x4822, the result is 0x5034 0x2248.
LCMAP_FULLWIDTHUse Unicode (wide) characters where applicable. This flag and LCMAP_HALFWIDTH are mutually exclusive.
LCMAP_HALFWIDTHUse narrow characters where applicable. This flag and LCMAP_FULLWIDTH are mutually exclusive.
LCMAP_HIRAGANAMap all katakana characters to hiragana. This flag and LCMAP_KATAKANA are mutually exclusive.
LCMAP_KATAKANAMap all hiragana characters to katakana. This flag and LCMAP_HIRAGANA are mutually exclusive.
LCMAP_LINGUISTIC_CASINGUse linguistic rules for casing, instead of file system rules (default). This flag is valid with LCMAP_LOWERCASE or LCMAP_UPPERCASE only.
LCMAP_LOWERCASEFor locales and scripts capable of handling uppercase and lowercase, map all characters to lowercase.
LCMAP_SIMPLIFIED_CHINESEMap traditional Chinese characters to simplified Chinese characters. This flag and LCMAP_TRADITIONAL_CHINESE are mutually exclusive.
LCMAP_SORTKEYProduce a normalized sort key. If the LCMAP_SORTKEY flag is not specified, the function performs string mapping. For details of sort key generation and string mapping, see the Remarks section.
LCMAP_TITLECASEWindows 7: Map all characters to title case, in which the first letter of each major word is capitalized.
LCMAP_TRADITIONAL_CHINESEMap simplified Chinese characters to traditional Chinese characters. This flag and LCMAP_SIMPLIFIED_CHINESE are mutually exclusive.
LCMAP_UPPERCASEFor locales and scripts capable of handling uppercase and lowercase, map all characters to uppercase.

The following flags can be used alone, with one another, or with the LCMAP_SORTKEY and/or LCMAP_BYTEREV flags. However, they cannot be combined with the other flags listed above.
FlagMeaning
NORM_IGNORENONSPACEIgnore nonspacing characters. For many scripts (notably Latin scripts), NORM_IGNORENONSPACE coincides with LINGUISTIC_IGNOREDIACRITIC.
Note NORM_IGNORENONSPACE ignores any secondary distinction, whether it is a diacritic or not. Scripts for Korean, Japanese, Chinese, and Indic languages, among others, use this distinction for purposes other than diacritics. LINGUISTIC_IGNOREDIACRITIC causes the function to ignore only actual diacritics, instead of ignoring the second sorting weight.
NORM_IGNORESYMBOLSIgnore symbols and punctuation.

The flags listed below are used only with the LCMAP_SORTKEY flag.
FlagMeaning
LINGUISTIC_IGNORECASEIgnore case, as linguistically appropriate.
LINGUISTIC_IGNOREDIACRITICIgnore nonspacing characters, as linguistically appropriate.
Note This flag does not always produce predictable results when used with decomposed characters, that is, characters in which a base character and one or more nonspacing characters each have distinct code point values.
NORM_IGNORECASEIgnore case. For many scripts (notably Latin scripts), NORM_IGNORECASE coincides with LINGUISTIC_IGNORECASE.
Note NORM_IGNORECASE ignores any tertiary distinction, whether it is actually linguistic case or not. For example, in Arabic and Indic scripts, this flag distinguishes alternate forms of a character, but the differences do not correspond to linguistic case. LINGUISTIC_IGNORECASE causes the function to ignore only actual linguistic casing, instead of ignoring the third sorting weight.
Note For double-byte character set (DBCS) locales, NORM_IGNORECASE has an effect on all Unicode characters as well as narrow (one-byte) characters, including Greek and Cyrillic characters.
NORM_IGNOREKANATYPEDo not differentiate between hiragana and katakana characters. Corresponding hiragana and katakana characters compare as equal.
NORM_IGNOREWIDTHIgnore the difference between half-width and full-width characters, for example, C a t == cat. The full-width form is a formatting distinction used in Chinese and Japanese scripts.
NORM_LINGUISTIC_CASINGUse linguistic rules for casing, instead of file system rules (default). For generating sort keys, this flag is not relevant. Use of NORM_LINGUISTIC_CASING has a similar effect.
SORT_DIGITSASNUMBERSWindows 7: Treat digits as numbers during sorting, for example, sort "2" before "10".
SORT_STRINGSORTTreat punctuation the same as symbols.

lpSrcStr [in]
Pointer to a source string that the function maps or uses for sort key generation. This string cannot have a size of 0.
cchSrc [in]
Size, in characters, of the source string indicated by lpSrcStr. The size of the source string can include the terminating null character, but does not have to. If the terminating null character is included, the mapping behavior of the function is not greatly affected because the terminating null character is considered to be unsortable and always maps to itself.
The application can set the parameter to any negative value to specify that the source string is null-terminated. In this case, if LCMapString is being used in its string-mapping mode, the function calculates the string length itself, and null-terminates the mapped string indicated by lpDestStr.
The application cannot set this parameter to 0.
lpDestStr [out]
Optional. Pointer to a buffer in which this function retrieves the mapped string or a sort key. When the application uses this function to generate a sort key, the destination string can contain an odd number of bytes. The LCMAP_BYTEREV flag only reverses an even number of bytes. The last byte (odd-positioned) in the sort key is not reversed.
Note The destination string can be the same as the source string only if LCMAP_UPPERCASE or LCMAP_LOWERCASE is set. Otherwise, the strings cannot be the same. If they are, the function fails.
Note Upon failure of the function, the destination buffer might contain either partial results or no results at all. In this case, it is recommended for your application to consider any results invalid.
cchDest [in]
Size, in characters, of the destination string indicated by lpDestStr. If the application is using the function for string mapping, it supplies a character count for this parameter. If space for a terminating null character is included in cchSrc, cchDest must also include space for a terminating null character.
If the application is using the function to generate a sort key, it supplies a byte count for the size. This byte count must include space for the sort key 0x00 terminator.
The application can set cchDest to 0. In this case, the function does not use the lpDestStr parameter and returns the required buffer size for the mapped string or sort key.
Return Value
Returns the number of characters or bytes in the translated string or sort key, including a terminating null character, if successful. If the function succeeds and the value of cchDest is 0, the return value is the size of the buffer required to hold the translated string or sort key, including a terminating null character.
This function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError , which can return one of the following error codes:
ERROR_INSUFFICIENT_BUFFER. A supplied buffer size was not large enough, or it was incorrectly set to NULL.
ERROR_INVALID_FLAGS. The values supplied for flags were not valid.
ERROR_INVALID_PARAMETER. Any of the parameter values was invalid.
Remarks
The application can use LCMapString or LCMapStringEx to generate a sort key. To do this, the application specifies LCMAP_SORTKEY for the dwMapFlags parameter. For more information, see Handling Sorting in Your Applications .
Another way for your application to use LCMapString or LCMapStringEx is in mapping strings. In this case, the application does not specify LCMAP_SORTKEY for the dwMapFlags parameter, but supplies some other combination of flags. For more information, see Handling Sorting in Your Applications .
Starting with Windows Vista, this function can handle data from custom locales . Data is not guaranteed to be the same from computer to computer or between runs of an application. If your application must persist or transmit data, see Using Persistent Locale Data .
The ANSI version of LCMapString maps strings to and from Unicode based on the default Windows (ANSI) code page associated with the specified locale. When the ANSI version of this function is used with a Unicode-only locale, the function can succeed because the operating system uses the CP_ACP value, representing the system default Windows ANSI code page. However, characters that are undefined in the system code page appear in the string as a question mark (?).
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinnls.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesLCMapStringW (Unicode) and LCMapStringA (ANSI)
See Also
National Language Support
National Language Support Functions
Handling Sorting in Your Applications
CompareString
FindNLSString
GetNLSVersion
LCMapStringEx
Send comments about this topic to Microsoft
Build date: 7/12/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd318700(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:28:17