Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.
STRCONV()
This function, added in version 3.0b, performs an assortment of conversions between different character sets. Among other things, it can be used in place of LOWER()
and UPPER()
. The parts we’re able to test without having double-byte data at hand seem to work.
cConvertedString = STRCONV( cOriginalString, nConversionType
[, nLocaleId ] )
Parameter |
Value |
Meaning |
cOriginalString |
Character |
The data you want to convert. |
nConversionType |
1 |
Change single-byte to double-byte. |
2 |
Change double-byte to single-byte. |
|
3, 4 |
Change between the two Japanese forms. |
|
5 |
Change double-byte to Unicode. |
|
6 |
Change Unicode to double-byte. |
|
7 |
Change to appropriate lowercase for nLocaleId. |
|
8 |
Change to appropriate uppercase for nLocaleId. |
|
nLocaleId |
Numeric |
Specifies the locale for lowercase and uppercase conversion. |
cConvertedString |
Character |
The original string after the specified conversion has been performed. |
The nLocaleId parameter was added in VFP 6. In English, there’s a one-to-one correspondence between lowercase and uppercase letters. However, in some languages, where some characters take accents, it’s not that simple. Specifying the locale you’re interested in makes it possible to handle these cases. Unfortunately, it doesn’t look as though you can simply pass any locale ID to see how your string would be converted—your version of Windows has to support that locale.
? STRCONV("This is a test", 7) && Returns "this is a test"