Home Oracle NLS_UPPER equivalent in Delphi
Reply: 1

Oracle NLS_UPPER equivalent in Delphi

GDF
1#
GDF Published in 2018-02-12 20:35:08Z

Is there an NLS_UPPER equivalent in Delphi? The only function I see is AnsiUpperCase, my question is does this Delphi function behave the same was as the Oracle NLS_UPPER function.

Ian Boyd
2#
Ian Boyd Reply to 2018-02-13 14:10:44Z
function NlsUpper(const s: string; const LocaleID: LCID): string;
var
    res: DWORD;
begin
    Result := s;
    UniqueString(Result);

    res := LCMapString(LocaleID, LCMAP_UPPERCASE or LCMAP_LINGUISTIC_CASING,
            PChar(Result), Length(Result),
            PChar(Result), Length(Result)   //for UpperCase and Lowercase, the destination can be the same as the source
    );
    if res = 0 then
        RaiseLastWin32Error;
end;

Usage:

var
   s: string;
const
   Locale_jpJP = $0411; //Japanese (Japan)
begin
   s := NlsUpper('こんにちは世界!', Locale_jpJP);
end;
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.297838 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO