rich2014
27063a7dca
Cocoa: improve in UTF8CodepointCount()
2024-08-30 21:32:05 +08:00
rich2014
c8a1f93a6e
LazUtf8: UTF8CodepointCount() added, which support combining code point
2024-08-29 21:27:20 +08:00
n7800
cc3fc445a5
LazUtils: Allow to specify replacement character in UTF8FixBroken
2024-08-12 14:16:50 +00:00
Juha
c43cda1cc5
LazUtils: Fix a typo in UTF8LowerCaseFast. Merge request !303 .
2024-07-11 00:20:24 +03:00
Juha
134275eeec
LazUtils: Move funcs QuickUtf8UpperCase and QuickUtf8LowerCase from FpDbgUtil to LazUTF8 and name them differently. Part of issue #40893 .
2024-06-29 11:55:58 +03:00
Juha
fee8dbf80e
LazUtils: Remove an inaccurate comment about optimization in UTF8CodepointSizeFast.
2024-02-28 10:37:08 +02:00
Juha
2c81dff5d9
LazUtils: Remove WriteLn() from TStringListUTF8Fast.InsertItem. Causes trouble on Windows.
2024-02-09 10:32:41 +02:00
Juha
890f92e33e
LazUtils: Deprecate UTF8CompareLatinTextFast. Implement TStringListUTF8Fast differently.
2024-02-09 01:20:36 +02:00
Maxim Ganetsky
4f8f408f97
LazUtils, UTF8WrapText: make sure that last BreakChar (e.g. space symbol) on line fits into wrapping length
2024-01-22 19:06:32 +03:00
Maxim Ganetsky
86e979c239
LazUtils: added UTF8WrapText overload which indents text similar to BreakString function from LazStringUtils unit
2024-01-20 05:04:42 +03:00
Juha
41adb276bb
Remove obsolete checks for FPC versions earlier then 3.0.
2023-07-07 17:39:02 +03:00
Maxim Ganetsky
65ed61c3ba
LazUtils: Make LazGetLanguageIDs and LazGetShortLanguageID procedures use results of GetLanguageID function from Translations unit. Also deprecate LazGetLanguageIDs and LazGetShortLanguageID.
2023-06-12 04:11:44 +03:00
Maxim Ganetsky
97c198b599
LazUtils: Remove special macOS handling from LazGetLanguageIDs procedure. Handle macOS just as any Unix.
...
For the record, the logic of this code was the following:
1. If the App Bundle does not do any Locale configuration, 'English' is
returned (i. e. not an ISO code).
2. If the App Bundle has configured the Locale configuration that
matches the user's system settings, it will return locale name from its
list, e. g. 'zh_CN'.
3. If the App Bundle cannot match the Locale of the user system, the
first item set in the App Bundle is returned (`en` in case of Lazarus).
So this code provided no tangible benefits and introduced dependency on
language list in Lazarus bundle. This list was outdated and thus
prevented autodetection of Czech, Hungarian, Brazilian Portuguese,
Ukrainian languages on macOS.
In case there will a need to reintroduce special macOS handling arise,
NSLocale.object() should be called with `countryCode` and `languageCode`
keys.
2023-06-11 20:10:26 +03:00
Maxim Ganetsky
e13533d1e1
LazUtils: merge LazTrimLanguageID to LazGetLanguageIDs, it is used only there now
2023-06-06 03:00:26 +03:00
Maxim Ganetsky
d05dd86b2c
LazUtils: simplify LazGetShortLanguageID procedure logic
...
It actually wants to return FallbackLang, so just return it and do not
make any assumptions about its length.
2023-06-03 19:18:40 +03:00
Maxim Ganetsky
e7b16e08e4
LazUtils: improved newly added language ID trimming procedure name (LazGetTrimmedLanguageID -> LazTrimLanguageID) in order to signify that it only transforms passed ID value
2023-06-02 02:03:46 +03:00
Maxim Ganetsky
42bcafe228
LazUtils, LCL: Trim encoding from found language ID if it presents there (e. g. ru_RU.utf8) in order to always correctly load translation files like project1.ru_RU.po. Based on patch by ACTom, merge request !182 .
2023-06-01 18:22:30 +03:00
Juha
ce9b92c95d
LazUtils: Remove a deprecated procedure.
2023-02-26 20:44:14 +02:00
Juha
20d2044bb4
LazUtils: In UTF8CompareLatinTextFast, use AnsiCompareText instead of WideCompareText.
2022-12-02 22:45:14 +02:00
Bart
46e8e195a9
LazUtf8: fix UTF8CompareLatinTextFast to be consistent with Utf8CompareText, when comparing lower ASCII values. Issue #40014
2022-11-25 17:26:14 +01:00
Bart
c67c745669
LazUtf8: honour CaseSensitive in TStringListUTF8Fast.DoCompareText.
2022-11-23 14:23:20 +01:00
Bart
4b313d25b3
LazUtf8: optimize Utf8StringReplace. Issue ##39576. Do NOT merge to 2.2 fixes!
2022-01-22 18:32:41 +01:00
Bart
24bb2eb1a4
LazUtf8: small optimization of Utf8EscapeControlChars.
2022-01-22 14:55:25 +01:00
Bart
0ff1e5d2a7
LazUtf8: pass language string parameters as const. Patch by Alexey Torgashin. Issue ##39577
2022-01-22 14:25:35 +01:00
Bart
242f0ac056
LazUtf8: faster implementation Utf8EscapeControlChars based upon idea by Alexey Torgashin. Issue #39573 .
2022-01-19 15:38:43 +01:00
Bart
18b5c2d3e2
LazUtf8: use PopCnt in Utf8LengthFast if instructionset supports it (currently X86 with -CpCOREI or higher).
2021-12-28 16:15:01 +01:00
Bart
71d44be64a
LazUtf8: use unsigned variables in Utf8LengthFast.
2021-12-28 14:29:01 +01:00
Bart
153a562187
LazUtf8: fix rangecheck error due to not detecting invalid 4-byte Utf8-codepoint in ConvertUTF8ToUTF16. Issue #39501 .
2021-12-11 19:17:44 +01:00
bart
7a69a2a702
LazUtf8: fix FindInvalidUtf8CodePoint for 3-byte encodings that encode for values reserved for UTF-16 surrogate halves.
...
git-svn-id: trunk@65246 -
2021-06-16 08:25:28 +00:00
maxim
6c7c5f4911
LazUtils: fixed typos related to 'occur' word
...
git-svn-id: trunk@65197 -
2021-06-10 22:10:27 +00:00
mattias
8396e2d0e0
lazutils: fixed ConvertUTF8ToUTF16 U+1FFFFF
...
git-svn-id: trunk@65182 -
2021-06-06 18:12:00 +00:00
mattias
63af733452
lazutils: fixed ConvertUTF8ToUTF16 U+1F600 and added tests
...
git-svn-id: trunk@65181 -
2021-06-06 17:50:54 +00:00
mattias
43ae6df320
lazutils: ConvertUTF8ToUTF16 and UTF8CodepointToUnicode check $10FFFF
...
git-svn-id: trunk@65166 -
2021-06-02 08:44:47 +00:00
mattias
6de8b92783
lazutils: UTF8FixBroken: fixing out of range and endless loop, added tests
...
git-svn-id: trunk@65163 -
2021-06-01 22:01:18 +00:00
mattias
c887c889e3
lazutils: FindInvalidUTF8Codepoint: check if bigger U+10FFFF
...
git-svn-id: trunk@65162 -
2021-06-01 21:02:23 +00:00
mattias
c54a8fa65a
lazutils: less hints
...
git-svn-id: trunk@65012 -
2021-04-17 11:30:56 +00:00
juha
4c27531f6f
LazUtils: Add function UTF8CompareTextP, use it in CompareFilenamesP.
...
git-svn-id: trunk@64391 -
2021-01-14 21:54:49 +00:00
juha
751852a44a
LazUtils: New function UTF8CompareLatinTextFast. Use in IDE instead of UTF8CompareText.
...
git-svn-id: trunk@64385 -
2021-01-14 13:52:23 +00:00
juha
a9aa51a93d
Tweak / optimization.
...
git-svn-id: trunk@64372 -
2021-01-10 19:07:46 +00:00
maxim
3d552017f1
LazUtils: commented out stray writeln, which was causing crashes on Windows after r64345 #865e21e88f
...
git-svn-id: trunk@64350 -
2021-01-08 00:43:07 +00:00
juha
865e21e88f
LazUtils: Optimize UTF8CompareText when codepoints have one byte. Applies to most filename comparisons.
...
git-svn-id: trunk@64345 -
2021-01-07 13:43:47 +00:00
bart
f47a2a5fd6
LazUtils: Remove tests for FPC versions 2.x.
...
git-svn-id: trunk@64122 -
2020-11-11 14:03:48 +00:00
juha
4321fbf6e5
LazUtils: move procedure ReplaceSubstring from LazUTF8 to LazStringUtils.
...
git-svn-id: trunk@64081 -
2020-10-29 15:45:34 +00:00
bart
5812e23a64
LazUtf8: add some more C-escape strings for the Utf8EscapeControlChars function.
...
git-svn-id: trunk@64062 -
2020-10-24 10:03:39 +00:00
mattias
0eb446e94a
lazutils: SysToUTF8: only UTF8_RTL, issue #35696 , from Serge Anvarov
...
git-svn-id: trunk@61352 -
2019-06-10 16:19:00 +00:00
bart
642a3a9b68
LazUtils: change order of new Count parameter in Utf8StringReplace/Utf16StringReplace.
...
git-svn-id: trunk@60429 -
2019-02-15 15:52:00 +00:00
bart
c452fc00e6
LazUtils: add optional Count parameter to Utf8StringReplace/Utf16StringReplace.
...
git-svn-id: trunk@60426 -
2019-02-15 13:56:08 +00:00
juha
64a3cced51
LazUtils: Added inlines to some functions in LazUTF8. Issue #34472 , patch from AlexeyT.
...
git-svn-id: trunk@59394 -
2018-10-30 11:04:21 +00:00
juha
c9e4614e17
Delete old deprecated methods.
...
git-svn-id: trunk@59175 -
2018-09-28 11:06:40 +00:00
bart
70f0e3209a
LazUtf8: leftpad escaped characters in Utf8EscapeControlChars if EscapeMode = emPascal. Prevents ambiguity when reading the result.
...
git-svn-id: trunk@59125 -
2018-09-22 09:57:01 +00:00