Jump to content

WinUpper

From EDM2
Revision as of 04:15, 9 April 2025 by Martini (talk | contribs) (Related Functions)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function converts a string to uppercase.

Syntax

WinUpper(hab, ulCodepage, ulCountry, pszString)

Parameters

hab (HAB) - Input
Anchor-block handle.
ulCodepage (ULONG) - Input
Code page.
0
Use the current-process code page.
Other
Use the specified code page.
ulCountry (ULONG) - Input
Country code.
0
Use the default country code specified in CONFIG.SYS.
Other
Use the specified country code.
pszString (PSZ) - In/Out
String to be converted to uppercase.

Returns

ulRetLen (ULONG) - returns
Length of converted string.

Remarks

The following is the list of valid code pages:

Canadian-French
863
Desktop Publishing
1004
Iceland
861
Latin 1 Multilingual
850
Latin 2 Multilingual
852
Nordic
865
Portuguese
860
Turkey
857
U.S. (IBM PC)
437

Code page 1004 is compatible with Microsoft Windows.

The following EBCDIC code pages, based on character set 697, are also available for output:

Austrian/German
273
Belgian
500
Brazil
037
Czechoslovakia
870
Danish/Norwegian
277
Finnish/Swedish
278
French
297
Hungary
870
Iceland
871
International
500
Italian
280
Poland
870
Portuguese
037
Spanish
284
Turkey
1026
U.K.-English
285
U.S.-English
037
Yugoslavia
870

Code pages 274 (Belgian) and 282 (Portuguese) can be used to provide access to old data.

The following is the list of valid country codes:

Arabic
785
Australian
61
Belgian
32
Canadian-French
2
Danish
45
Finnish
358
French
33
German
49
Hebrew
972
Italian
39
Japanese
81
Korean
82
Latin-American
3
Netherlands
31
Norwegian
47
Portuguese
351
Simpl. Chinese
86
Spanish
34
Swedish
46
Swiss
41
Trad. Chinese
88
UK-English
44
US-English
1
Other country
0

Errors

Possible returns from WinGetLastError:

  • PMERR_INVALID_STRING_PARM (0x100B) - The specified string parameter is invalid.

Example Code

This example shows how the WinUpper call can be used to convert a strings in NLS languages to uppercase.

#define INCL_WINCOUNTRY
#include <OS2.H>
#include <stdio.h>
main()
{
HAB hab;
char szString[] = "hablas español?";
hab = WinInitialize(0);
WinUpper(hab,
         850,
         34,
         szString);
WinTerminate(hab);
}

Related Functions