Skip to content

Instantly share code, notes, and snippets.

@jpluimers
Created March 28, 2017 11:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpluimers/ecc7ded715369028a5142bdc4f601327 to your computer and use it in GitHub Desktop.
Save jpluimers/ecc7ded715369028a5142bdc4f601327 to your computer and use it in GitHub Desktop.
diff to make Delphi XE8 case conversions compatible with Turkish locale
diff "C:\\Program Files (x86)\\Embarcadero\\Studio\\16.0\\source\\IBX/IBX.IBCustomDataSet.pas" IBX/IBX.IBCustomDataSet.pas
3943c3943
< Old := PName.ToUpper.StartsWith('OLD_'); {do not localize}
---
> Old := PName.ToUpperInvariant.StartsWith('OLD_'); {do not localize}
diff "C:\\Program Files (x86)\\Embarcadero\\Studio\\16.0\\source\\IBX/IBX.IBDatabase.pas" IBX/IBX.IBDatabase.pas
723c723
< not Params.Text.ToUpper.Contains('FILE ') then {do not localize}
---
> not Params.Text.ToUpperInvariant.Contains('FILE ') then {do not localize}
734c734
< if TempDBParams[i].ToUpper.Contains('FILE ') then {do not localize}
---
> if TempDBParams[i].ToUpperInvariant.Contains('FILE ') then {do not localize}
754c754
< lc_ctype := Params.Values['lc_ctype'].ToUpper; {do not localize}
---
> lc_ctype := Params.Values['lc_ctype'].ToUpperInvariant; {do not localize}
756c756
< lc_ctype := Params.Values['isc_dpb_lc_ctype'].ToUpper; {do not localize}
---
> lc_ctype := Params.Values['isc_dpb_lc_ctype'].ToUpperInvariant; {do not localize}
760c760
< b := TEncoding.Convert(TEncoding.Default, TEncoding.ANSI, BytesOf(Format(sDefaultCharset, [lc_ctype.ToUpper])));
---
> b := TEncoding.Convert(TEncoding.Default, TEncoding.ANSI, BytesOf(Format(sDefaultCharset, [lc_ctype.ToUpperInvariant])));
774c774
< if Params.Text.ToUpper.Contains('FILE ') then {do not localize}
---
> if Params.Text.ToUpperInvariant.Contains('FILE ') then {do not localize}
778c778
< if Params[i].ToUpper.Contains('FILE ') then {do not localize }
---
> if Params[i].ToUpperInvariant.Contains('FILE ') then {do not localize }
930c930
< pos_of_str := Params[i].ToLower.IndexOf(st);
---
> pos_of_str := Params[i].ToLowerInvariant.IndexOf(st);
1107c1107
< if Params.Names[i].Trim.ToLower.StartsWith('password') then {do not localize}
---
> if Params.Names[i].Trim.ToLowerInvariant.StartsWith('password') then {do not localize}
2566c2566
< ParamName := sl[i].ToLower;
---
> ParamName := sl[i].ToLowerInvariant;
2571c2571
< ParamName := sl.Names[i].ToLower;
---
> ParamName := sl.Names[i].ToLowerInvariant;
2744c2744
< ParamName := sl[i].ToLower
---
> ParamName := sl[i].ToLowerInvariant
2747c2747
< ParamName := sl.Names[i].ToLower;
---
> ParamName := sl.Names[i].ToLowerInvariant;
diff "C:\\Program Files (x86)\\Embarcadero\\Studio\\16.0\\source\\IBX/IBX.IBDatabaseINI.pas" IBX/IBX.IBDatabaseINI.pas
127c127
< if FDatabase.Params.Names[i].ToLower.StartsWith(Name.ToLower) then
---
> if FDatabase.Params.Names[i].ToLowerInvariant.StartsWith(Name.ToLowerInvariant) then
166c166
< if FDatabase.Params.Names[i].ToLower.StartsWith(Name.ToLower) then
---
> if FDatabase.Params.Names[i].ToLowerInvariant.StartsWith(Name.ToLowerInvariant) then
183c183
< if FDatabase.Params.Names[i].ToLower.StartsWith(Name.ToLower) then
---
> if FDatabase.Params.Names[i].ToLowerInvariant.StartsWith(Name.ToLowerInvariant) then
diff "C:\\Program Files (x86)\\Embarcadero\\Studio\\16.0\\source\\IBX/IBX.IBExtract.pas" IBX/IBX.IBExtract.pas
449c449
< i := default.ToUpper.IndexOf('DEFAULT ') + 8;
---
> i := default.ToUpperInvariant.IndexOf('DEFAULT ') + 8;
1696c1696
< if qryDomains.FieldByName('RDB$VALIDATION_SOURCE').AsTrimString.ToUpper.StartsWith('CHECK') then {do not localize}
---
> if qryDomains.FieldByName('RDB$VALIDATION_SOURCE').AsTrimString.ToUpperInvariant.StartsWith('CHECK') then {do not localize}
2520c2520
< if 'check'.StartsWith(ToValidate.ToLower) then {do not localize}
---
> if 'check'.StartsWith(ToValidate.ToLowerInvariant) then {do not localize}
diff "C:\\Program Files (x86)\\Embarcadero\\Studio\\16.0\\source\\IBX/IBX.IBFilterDialog.pas" IBX/IBX.IBFilterDialog.pas
171c171
< s := ' ' + AnsiUpperCase(AString) + ' '; {do not localize}
---
> s := ' ' + UpperCase(AString, TLocaleOptions.loInvariantLocale) + ' '; {do not localize}
175c175
< p := Pos(' ' + AnsiUpperCase(AWord) + ' ', s); {do not localize}
---
> p := Pos(' ' + UpperCase(AWord, TLocaleOptions.loInvariantLocale) + ' ', s); {do not localize}
896c896
< if AnsiUpperCase(FilterValue) = 'NULL' then {do not localize}
---
> if UpperCase(FilterValue, TLocaleOptions.loInvariantLocale) = 'NULL' then {do not localize}
976c976
< if AnsiUpperCase(FilterValue) = 'NULL' then {do not localize}
---
> if UpperCase(FilterValue, TLocaleOptions.loInvariantLocale) = 'NULL' then {do not localize}
diff "C:\\Program Files (x86)\\Embarcadero\\Studio\\16.0\\source\\IBX/IBX.IBIntf.pas" IBX/IBX.IBIntf.pas
1700c1700
< if aLibrary.ToLower = IBClientInterface.ToArray[i].Key.ToLower then
---
> if aLibrary.ToLowerInvariant = IBClientInterface.ToArray[i].Key.ToLowerInvariant then
diff "C:\\Program Files (x86)\\Embarcadero\\Studio\\16.0\\source\\IBX/IBX.IBScript.pas" IBX/IBX.IBScript.pas
345c345
< Token := UpperCase(FTokens[0]);
---
> Token := UpperCase(FTokens[0], TLocaleOptions.loInvariantLocale);
413c413
< Token1 := UpperCase(FTokens[1]);
---
> Token1 := UpperCase(FTokens[1], TLocaleOptions.loInvariantLocale);
454c454
< (FTokens.Count > 2) and (UpperCase(FTokens[2]) = 'INDEX')) then {do not localize}
---
> (FTokens.Count > 2) and (UpperCase(FTokens[2], TLocaleOptions.loInvariantLocale) = 'INDEX')) then {do not localize}
467c467
< (UpperCase(FTokens[2]) = 'DIALECT') then {do not localize}
---
> (UpperCase(FTokens[2], TLocaleOptions.loInvariantLocale) = 'DIALECT') then {do not localize}
589c589
< (UpperCase(FTokens[FTokens.Count - 2]) = 'END') and {do not localize}
---
> (UpperCase(FTokens[FTokens.Count - 2], TLocaleOptions.loInvariantLocale) = 'END') and {do not localize}
593,596c593,596
< (UpperCase(FTokens[0]) = 'ALTER') and {do not localize}
< (UpperCase(FTokens[1]) = 'TRIGGER') and {do not localize}
< ((UpperCase(FTokens[3]) = 'ACTIVE') or {do not localize}
< (UpperCase(FTokens[3]) = 'INACTIVE')) and {do not localize}
---
> (UpperCase(FTokens[0], TLocaleOptions.loInvariantLocale) = 'ALTER') and {do not localize}
> (UpperCase(FTokens[1], TLocaleOptions.loInvariantLocale) = 'TRIGGER') and {do not localize}
> ((UpperCase(FTokens[3], TLocaleOptions.loInvariantLocale) = 'ACTIVE') or {do not localize}
> (UpperCase(FTokens[3], TLocaleOptions.loInvariantLocale) = 'INACTIVE')) and {do not localize}
607c607
< NextWord := NextWord.ToUpper.Trim;
---
> NextWord := NextWord.ToUpperInvariant.Trim;
609c609
< FTokens.Add(NextWord.ToUpper);
---
> FTokens.Add(NextWord.ToUpperInvariant);
665,668c665,668
< ((UpperCase(FTokens[0]) = 'CREATE') or {do not localize}
< (UpperCase(FTokens[0]) = 'ALTER')) and {do not localize}
< ((UpperCase(NextWord) = 'PROCEDURE') or {do not localize}
< (UpperCase(NextWord) = 'TRIGGER')) and {do not localize}
---
> ((UpperCase(FTokens[0], TLocaleOptions.loInvariantLocale) = 'CREATE') or {do not localize}
> (UpperCase(FTokens[0], TLocaleOptions.loInvariantLocale) = 'ALTER')) and {do not localize}
> ((UpperCase(NextWord, TLocaleOptions.loInvariantLocale) = 'PROCEDURE') or {do not localize}
> (UpperCase(NextWord, TLocaleOptions.loInvariantLocale) = 'TRIGGER')) and {do not localize}
671c671
< if InSpecial and (NextWord.ToUpper = 'END;') then {do not localize}
---
> if InSpecial and (NextWord.ToUpperInvariant = 'END;') then {do not localize}
677,680c677,680
< (UpperCase(FTokens[0]) = 'ALTER') and {do not localize}
< (UpperCase(FTokens[1]) = 'TRIGGER') and {do not localize}
< ((UpperCase(FTokens[3]) = 'ACTIVE;') or {do not localize}
< ((UpperCase(FTokens[3]) = 'INACTIVE;'))) then {do not localize}
---
> (UpperCase(FTokens[0], TLocaleOptions.loInvariantLocale) = 'ALTER') and {do not localize}
> (UpperCase(FTokens[1], TLocaleOptions.loInvariantLocale) = 'TRIGGER') and {do not localize}
> ((UpperCase(FTokens[3], TLocaleOptions.loInvariantLocale) = 'ACTIVE;') or {do not localize}
> ((UpperCase(FTokens[3], TLocaleOptions.loInvariantLocale) = 'INACTIVE;'))) then {do not localize}
682c682
< if UpperCase(NextWord) = 'ACTIVE;' then {do not localize}
---
> if UpperCase(NextWord, TLocaleOptions.loInvariantLocale) = 'ACTIVE;' then {do not localize}
795,803c795,803
< Result := not ((FSQLParser.CurrentTokens[i].ToUpper = 'NO_RESERVE') or {do not localize }
< (FSQLParser.CurrentTokens[i].ToUpper = 'SET_PAGE_BUFFERS') or {do not localize }
< (FSQLParser.CurrentTokens[i].ToUpper = 'PREALLOCATE') or {do not localize }
< (FSQLParser.CurrentTokens[i].ToUpper = 'FORCE_WRITE') or {do not localize }
< (FSQLParser.CurrentTokens[i].ToUpper = 'SQL_DIALECT') or {do not localize }
< (FSQLParser.CurrentTokens[i].ToUpper = 'SET_GROUP_COMMIT') or {do not localize }
< (FSQLParser.CurrentTokens[i].ToUpper = 'SWEEP_INTERVAL') or {do not localize }
< (FSQLParser.CurrentTokens[i].ToUpper = 'TRANSACTION') or {do not localize }
< (FSQLParser.CurrentTokens[i].ToUpper = 'ODS_VERSION_MAJOR')); {do not localize }
---
> Result := not ((FSQLParser.CurrentTokens[i].ToUpperInvariant = 'NO_RESERVE') or {do not localize }
> (FSQLParser.CurrentTokens[i].ToUpperInvariant = 'SET_PAGE_BUFFERS') or {do not localize }
> (FSQLParser.CurrentTokens[i].ToUpperInvariant = 'PREALLOCATE') or {do not localize }
> (FSQLParser.CurrentTokens[i].ToUpperInvariant = 'FORCE_WRITE') or {do not localize }
> (FSQLParser.CurrentTokens[i].ToUpperInvariant = 'SQL_DIALECT') or {do not localize }
> (FSQLParser.CurrentTokens[i].ToUpperInvariant = 'SET_GROUP_COMMIT') or {do not localize }
> (FSQLParser.CurrentTokens[i].ToUpperInvariant = 'SWEEP_INTERVAL') or {do not localize }
> (FSQLParser.CurrentTokens[i].ToUpperInvariant = 'TRANSACTION') or {do not localize }
> (FSQLParser.CurrentTokens[i].ToUpperInvariant = 'ODS_VERSION_MAJOR')); {do not localize }
829c829
< (FSQLParser.CurrentTokens[i].ToUpper = 'USER') then {do not localize}
---
> (FSQLParser.CurrentTokens[i].ToUpperInvariant = 'USER') then {do not localize}
836c836
< (FSQLParser.CurrentTokens[i].ToUpper = 'PASSWORD') then {do not localize}
---
> (FSQLParser.CurrentTokens[i].ToUpperInvariant = 'PASSWORD') then {do not localize}
842c842
< if FSQLParser.CurrentTokens[i].ToUpper.Contains('PAGE_SIZE') then {do not localize}
---
> if FSQLParser.CurrentTokens[i].ToUpperInvariant.Contains('PAGE_SIZE') then {do not localize}
860,862c860,862
< (FSQLParser.CurrentTokens[i].ToUpper = 'WITH') and {do not localize}
< (FSQLParser.CurrentTokens[i+1].ToUpper = 'ADMIN') and {do not localize}
< (FSQLParser.CurrentTokens[i+2].ToUpper = 'OPTION') then {do not localize}
---
> (FSQLParser.CurrentTokens[i].ToUpperInvariant = 'WITH') and {do not localize}
> (FSQLParser.CurrentTokens[i+1].ToUpperInvariant = 'ADMIN') and {do not localize}
> (FSQLParser.CurrentTokens[i+2].ToUpperInvariant = 'OPTION') then {do not localize}
869,871c869,871
< (FSQLParser.CurrentTokens[i].ToUpper = 'DEFAULT') and {do not localize}
< (FSQLParser.CurrentTokens[i+1].ToUpper = 'CHARACTER') and {do not localize}
< (FSQLParser.CurrentTokens[i+2].ToUpper = 'SET') then {do not localize}
---
> (FSQLParser.CurrentTokens[i].ToUpperInvariant = 'DEFAULT') and {do not localize}
> (FSQLParser.CurrentTokens[i+1].ToUpperInvariant = 'CHARACTER') and {do not localize}
> (FSQLParser.CurrentTokens[i+2].ToUpperInvariant = 'SET') then {do not localize}
877c877
< if FSQLParser.CurrentTokens[i].ToUpper = 'NO_RESERVE' then {do not localize}
---
> if FSQLParser.CurrentTokens[i].ToUpperInvariant = 'NO_RESERVE' then {do not localize}
883c883
< if FSQLParser.CurrentTokens[i].ToUpper = 'SET_GROUP_COMMIT' then {do not localize}
---
> if FSQLParser.CurrentTokens[i].ToUpperInvariant = 'SET_GROUP_COMMIT' then {do not localize}
890c890
< (FSQLParser.CurrentTokens[i].ToUpper = 'SET_PAGE_BUFFERS') then {do not localize}
---
> (FSQLParser.CurrentTokens[i].ToUpperInvariant = 'SET_PAGE_BUFFERS') then {do not localize}
897c897
< (FSQLParser.CurrentTokens[i].ToUpper = 'PREALLOCATE') then {do not localize}
---
> (FSQLParser.CurrentTokens[i].ToUpperInvariant = 'PREALLOCATE') then {do not localize}
904c904
< (FSQLParser.CurrentTokens[i].ToUpper = 'ODS_VERSION_MAJOR') then {do not localize}
---
> (FSQLParser.CurrentTokens[i].ToUpperInvariant = 'ODS_VERSION_MAJOR') then {do not localize}
911c911
< (FSQLParser.CurrentTokens[i].ToUpper = 'SQL_DIALECT') then {do not localize}
---
> (FSQLParser.CurrentTokens[i].ToUpperInvariant = 'SQL_DIALECT') then {do not localize}
918c918
< (FSQLParser.CurrentTokens[i].ToUpper = 'SWEEP_INTERVAL') then {do not localize}
---
> (FSQLParser.CurrentTokens[i].ToUpperInvariant = 'SWEEP_INTERVAL') then {do not localize}
925c925
< (FSQLParser.CurrentTokens[i].ToUpper = 'TRANSACTION') then {do not localize}
---
> (FSQLParser.CurrentTokens[i].ToUpperInvariant = 'TRANSACTION') then {do not localize}
932c932
< (FSQLParser.CurrentTokens[i].ToUpper = 'FORCE_WRITE') then {do not localize}
---
> (FSQLParser.CurrentTokens[i].ToUpperInvariant = 'FORCE_WRITE') then {do not localize}
934c934
< if FSQLParser.CurrentTokens[i+1].ToUpper = 'ASYNC' then {do not localize}
---
> if FSQLParser.CurrentTokens[i+1].ToUpperInvariant = 'ASYNC' then {do not localize}
936c936
< if FSQLParser.CurrentTokens[i+1].ToUpper = 'SYNC' then {do not localize}
---
> if FSQLParser.CurrentTokens[i+1].ToUpperInvariant = 'SYNC' then {do not localize}
938c938
< if FSQLParser.CurrentTokens[i+1].ToUpper = 'DIRECT' then {do not localize}
---
> if FSQLParser.CurrentTokens[i+1].ToUpperInvariant = 'DIRECT' then {do not localize}
944c944
< (FSQLParser.CurrentTokens[i].ToUpper = 'FILE') then {do not localize}
---
> (FSQLParser.CurrentTokens[i].ToUpperInvariant = 'FILE') then {do not localize}
949c949
< (FSQLParser.CurrentTokens[i].ToUpper.Contains('LENGTH')) then {do not localize}
---
> (FSQLParser.CurrentTokens[i].ToUpperInvariant.Contains('LENGTH')) then {do not localize}
966c966
< if FSQLParser.CurrentTokens[i].ToUpper = 'STARTING' then {do not localize}
---
> if FSQLParser.CurrentTokens[i].ToUpperInvariant = 'STARTING' then {do not localize}
971c971
< (FSQLParser.CurrentTokens[i].ToUpper = 'AT') then {do not localize}
---
> (FSQLParser.CurrentTokens[i].ToUpperInvariant = 'AT') then {do not localize}
977c977
< (FSQLParser.CurrentTokens[i].ToUpper = 'PAGE') then {do not localize}
---
> (FSQLParser.CurrentTokens[i].ToUpperInvariant = 'PAGE') then {do not localize}
989c989
< (FSQLParser.CurrentTokens[i].ToUpper = 'LENGTH') then {do not localize}
---
> (FSQLParser.CurrentTokens[i].ToUpperInvariant = 'LENGTH') then {do not localize}
1240,1241c1240,1241
< (UpperCase(FSQLParser.CurrentTokens[1]) = 'TO') and {do not localize}
< (UpperCase(FSQLParser.CurrentTokens[2]) = 'SAVEPOINT')) then {do not localize}
---
> (UpperCase(FSQLParser.CurrentTokens[1], TLocaleOptions.loInvariantLocale) = 'TO') and {do not localize}
> (UpperCase(FSQLParser.CurrentTokens[2], TLocaleOptions.loInvariantLocale) = 'SAVEPOINT')) then {do not localize}
1245,1246c1245,1246
< (UpperCase(FSQLParser.CurrentTokens[2]) = 'TO') and {do not localize}
< (UpperCase(FSQLParser.CurrentTokens[3]) = 'SAVEPOINT')) then {do not localize}
---
> (UpperCase(FSQLParser.CurrentTokens[2], TLocaleOptions.loInvariantLocale) = 'TO') and {do not localize}
> (UpperCase(FSQLParser.CurrentTokens[3], TLocaleOptions.loInvariantLocale) = 'SAVEPOINT')) then {do not localize}
diff "C:\\Program Files (x86)\\Embarcadero\\Studio\\16.0\\source\\IBX/IBX.IBServices.pas" IBX/IBX.IBServices.pas
1047c1047
< pos_of_str := Params[i].ToLower.IndexOf(st);
---
> pos_of_str := Params[i].ToLowerInvariant.IndexOf(st);
1150c1150
< param_name := sl.Names[i].ToLower;
---
> param_name := sl.Names[i].ToLowerInvariant;
2192c2192
< sl.Add(UpperCase(S));
---
> sl.Add(UpperCase(S, TLocaleOptions.loInvariantLocale));
diff "C:\\Program Files (x86)\\Embarcadero\\Studio\\16.0\\source\\IBX/IBX.IBTable.pas" IBX/IBX.IBTable.pas
585c585
< if Name.Trim.ToUpper.Contains('RDB$PRIMARY') then {do not localize} {mbcs ok}
---
> if Name.Trim.ToUpperInvariant.Contains('RDB$PRIMARY') then {do not localize} {mbcs ok}
diff "C:\\Program Files (x86)\\Embarcadero\\Studio\\16.0\\source\\IBX/IBX.IBUpdateSQL.pas" IBX/IBX.IBUpdateSQL.pas
173c173
< Old := PName.ToUpper.StartsWith('OLD_'); {do not localize}
---
> Old := PName.ToUpperInvariant.StartsWith('OLD_'); {do not localize}
diff "C:\\Program Files (x86)\\Embarcadero\\Studio\\16.0\\source\\IBX/IBX.IBUtils.pas" IBX/IBX.IBUtils.pas
125c125
< Value := AnsiUpperCase(Value)
---
> Value := UpperCase(Value, TLocaleOptions.loInvariantLocale)
130c130
< Value := AnsiUpperCase(Value);
---
> Value := UpperCase(Value, TLocaleOptions.loInvariantLocale);
138c138
< Value := Value.ToUpper
---
> Value := Value.ToUpperInvariant
148c148
< Value := Value.ToUpper;
---
> Value := Value.ToUpperInvariant;
157c157
< Value := Value.ToUpper
---
> Value := Value.ToUpperInvariant
167c167
< Value := Value.ToUpper;
---
> Value := Value.ToUpperInvariant;
175c175
< Value := Value.Trim.ToUpper
---
> Value := Value.Trim.ToUpperInvariant
198c198
< if Result.ToLower.Contains(SWhere) then
---
> if Result.ToLowerInvariant.Contains(SWhere) then
378c378
< idx1 := DatabaseName.ToLower.IndexOf('?ssl=true'); {do not localize}
---
> idx1 := DatabaseName.ToLowerInvariant.IndexOf('?ssl=true'); {do not localize}
423c423
< idx1 := SSLSection.ToLower.IndexOf(SPF);
---
> idx1 := SSLSection.ToLowerInvariant.IndexOf(SPF);
427c427
< idx1 := SSLSection.ToLower.IndexOf(SPP);
---
> idx1 := SSLSection.ToLowerInvariant.IndexOf(SPP);
431c431
< idx1 := SSLSection.ToLower.IndexOf(CCF);
---
> idx1 := SSLSection.ToLowerInvariant.IndexOf(CCF);
435c435
< idx1 := SSLSection.ToLower.IndexOf(CPPF);
---
> idx1 := SSLSection.ToLowerInvariant.IndexOf(CPPF);
439c439
< idx1 := SSLSection.ToLower.IndexOf(CPP);
---
> idx1 := SSLSection.ToLowerInvariant.IndexOf(CPP);
Only in IBX: __history
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment