Commit Graph

162 Commits

Author SHA1 Message Date
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
juha
ed1cd9335d LazUtils: Add a new function UTF8ProperCase() to unit LazUTF8.
git-svn-id: trunk@56892 -
2017-12-31 08:49:05 +00:00
juha
f8be53b0e6 LazUtils: Change "Character" to "Codepoint" also in some parameter names in LazUTF8. Cleanup.
git-svn-id: trunk@56708 -
2017-12-13 00:07:00 +00:00
juha
6810c626df LazUtils: Change "Character" to "Codepoint" in LazUTF8 function names to be more accurate and to avoid confusion.
git-svn-id: trunk@56692 -
2017-12-11 19:44:22 +00:00
mattias
8fa91fbd06 lazutf8: fixed UTF8LowerCase CIRCLED LATIN CAPITAL LETTER K
git-svn-id: trunk@56665 -
2017-12-07 19:43:10 +00:00
juha
be0dcc0b50 LazUtils: Fix errors in LazUTF8.UTF8LowerCase. By forum user Munair.
git-svn-id: trunk@56662 -
2017-12-07 15:54:54 +00:00
juha
962f0fce09 LazUtils: Improve function UTF8LengthFast. From forum user "engkin".
git-svn-id: trunk@56572 -
2017-12-01 13:54:45 +00:00
juha
d10aed499e LazUtils: Improve function UTF8RPos. Use RPos and UTF8Length instead of reversing the whole string.
git-svn-id: trunk@56529 -
2017-11-28 21:29:05 +00:00
mattias
90dd28d142 lazutils: simplified
git-svn-id: trunk@56163 -
2017-10-23 09:35:35 +00:00
mattias
6e41e1e216 lazutils: fixed UTF8CharacterLengthFast
git-svn-id: trunk@55218 -
2017-06-04 20:18:38 +00:00
juha
e27232d4cc Fix uninitialized variables based on compiler warnings got with dfa (data flow analysis) enabled.
git-svn-id: trunk@55211 -
2017-06-04 15:14:29 +00:00
bart
a3a7c54e1e LazUtf8: fix compilation for WinCE. Issue #0031788.
git-svn-id: trunk@54845 -
2017-05-09 19:21:42 +00:00
juha
1e29783c40 More formatting.
git-svn-id: trunk@54377 -
2017-03-08 22:15:56 +00:00
mattias
63b12d5281 lazutf8: under Windows use W function for GetEnvironmentStringUTF8 and GetEnvironmentVariable
git-svn-id: trunk@54269 -
2017-02-25 12:24:25 +00:00
mattias
9d411abe20 docs: UnicodeToUTF8
git-svn-id: trunk@53964 -
2017-01-17 15:28:04 +00:00
juha
39fe54c5f6 Make LCL and LazUtils compile for Amiga systems (NoGUI). Issue #31186, patch from Marcus Sackrow.
git-svn-id: trunk@53853 -
2017-01-03 12:01:49 +00:00
bart
545d1bb66f LazUtf8: Fix UnicodeToUtf8 for CodePoint = 0. Issue #0031103.
git-svn-id: trunk@53659 -
2016-12-12 20:55:42 +00:00
mattias
eefe2518a1 lazutils: comment
git-svn-id: trunk@53300 -
2016-11-05 14:57:02 +00:00
bart
39750fff57 LazUtf8
- deprecate ValidUTF8String() (confusing name)
- implement Utf8EscapeControlChars()
Resolves Issue #0030821.

git-svn-id: trunk@53297 -
2016-11-04 14:23:20 +00:00
mattias
bc57de6bb9 lazutf8: improved UTF8CharacterLength and UTF8CharacterLengthFast
git-svn-id: trunk@52857 -
2016-08-21 21:14:01 +00:00
juha
413f000fc0 LazUtils: Return 1 also for char #0 in UTF8CharacterLengthFast. Matches the logic in UTF8CharacterLength.
git-svn-id: trunk@52856 -
2016-08-21 19:48:01 +00:00
juha
01c9a4b4d7 LazUtils: Add fast versions of UTF8CharacterLength and UTF8Length. Use them in LazUnicode unit.
git-svn-id: trunk@52853 -
2016-08-21 16:37:02 +00:00
mattias
824e8f1f9d lazutils: fixed compilation on non windows
git-svn-id: trunk@52481 -
2016-06-12 06:55:16 +00:00
ondrej
b08c38cba0 lazutils: fix GetFormatSettingsUTF8, make it public
git-svn-id: trunk@52479 -
2016-06-12 05:57:58 +00:00
juha
ba872ba5b1 LazUtils: Use cwstring always on unix systems. WideCompare* functions require it.
git-svn-id: trunk@52442 -
2016-06-05 08:26:52 +00:00
juha
2c41ccf609 Formatting, comment.
git-svn-id: trunk@52109 -
2016-04-06 10:19:12 +00:00
bart
7c9fc905a6 LazUtf8: In UTF8CompareStrCollated only call AnsiCompareStr is ACP_RTL is defined, since in all other cases
AnsiCompareStr = widestringmanager.CompareStrAnsiStringProc = UTF8CompareStr.
If ACP_RTL is not defined call Utf8CompareStr, since this is now does proper collation and is faster than
converting to WideString.

git-svn-id: trunk@51978 -
2016-03-17 12:07:57 +00:00
bart
77e5428b3f LazUtf8: firts attempt to rewrite Utf8CompareStr and Utf8CompareText so that it's results will be more consistent with
AnsiCompareStr/WideCompareStr and AnsiCompareTex/WideCompareText.
(
The old implementation was in effect a copy of CompareStr and, this made the claim about proper collation in
Utf8CompareText (which uses Utf8CompareStr) rather ludicrous.
The new implementaion is slower, mainly becaus of the fact we cannot use CompareMemrange/CompareByte anymore,
and we have to iterate the bytes ourselves. This fact alone contributes much more to the loss in speed than
the fact we use WideCompareStr on the 2 differing codepoints:
- iterating in a for loop: adss a factor of appr. 10 to the time needed
- using the final WideCompareStr adds a factor of about 1.6 to the time meeded.
Because of the slowdown in speed in Utf8CompareStr, Utf8CompareText now calls WideCompareText directly, which is
now appr. the same speed as converting to lowercase and then calling Utf8CompareStr
)

git-svn-id: trunk@51977 -
2016-03-17 11:38:56 +00:00
bart
b192fb9760 LazUtf8: Refactor UTF8FindNearestCharStart. Resolves Issue #0029851.
git-svn-id: trunk@51973 -
2016-03-17 10:42:52 +00:00
bart
34be9ae2d0 LazUtf8: implement Utf8TryFindCodepointStart.
git-svn-id: trunk@51972 -
2016-03-17 10:39:52 +00:00
juha
d93952201f LazUtils: Fix compilation on darwin. Issue #29843, patch from lks.
git-svn-id: trunk@51957 -
2016-03-16 07:05:26 +00:00
bart
23f36140b5 LazUtf8: implement Utf8ReverseString and Utf8RPos. Patch by Bernard Marcelly. Issue #0029817.
git-svn-id: trunk@51927 -
2016-03-12 14:01:03 +00:00
bart
2683bc53a8 LazUtils: Prevent CopyDirTree copying to a subdirectory of source: handle unicode characters.
git-svn-id: trunk@51692 -
2016-02-24 23:07:19 +00:00
bart
f09c665b2a LazUtf8: fix Utf8LowerCase for #$E2#$B1#$AD (LATIN CAPITAL LETTER ALPHA)
git-svn-id: trunk@51688 -
2016-02-24 22:26:58 +00:00
bart
39da734bec LazUtils: fix compilation for WinCE.
git-svn-id: trunk@51026 -
2015-12-24 18:08:42 +00:00
bart
894c125543 LazUtils: Second attempt to implement Utf8Delete() for parameters of type Utf8String.
git-svn-id: trunk@50910 -
2015-12-18 17:59:39 +00:00
bart
b3035175ac LazUtils: implement Utf8Delete() and Utf8Insert() for parameters of type Utf8String. (Only needed for these, since they use var parameters).
git-svn-id: trunk@50850 -
2015-12-16 17:07:58 +00:00
mattias
9a471bcd00 lazutils: fixed compilation under Windows
git-svn-id: trunk@50729 -
2015-12-09 23:35:07 +00:00
mattias
b48a3ea89e lazutils: UTF8ToWinCP for Unix
git-svn-id: trunk@50723 -
2015-12-09 22:58:30 +00:00
bart
0c8df133dd LazUtils:
- An attempt to unify the defines for the different scenario's in the use of (not) codepage aware ansistrings
  and the use of the "Utf8 in RTL" feature.
  It makes for better separation of code and thus better readability and ease of maintainance (and in a later
  stadium it makes it easier to remove code that deals with non codepage aware ansistrings (fpc < 3.0)).
- Also replace (FPC_FULLVERSION >= xxxx) with FPC_HAS_CPSTRING where appropriate.
- Replace the custom HasCP define with built in FPC_HAS_CPSTRING define.

git-svn-id: trunk@50498 -
2015-11-24 16:23:18 +00:00
juha
5fc7132693 Use the new UTF-8 system by default. Can be disabled by define DisableUTF8RTL. EnableUTF8RTL is removed.
git-svn-id: trunk@50129 -
2015-10-20 17:20:11 +00:00
mattias
dcfae18d9a lazutils: comments
git-svn-id: trunk@49664 -
2015-08-13 10:13:05 +00:00
juha
06ac76f560 LazUtils, unit FileUtil: Disable conditionally LazUtf8 and LazFileUtils wrapper functions. For testing define NoLazUTF8Wrappers and build Lazarus.
git-svn-id: trunk@49494 -
2015-07-04 23:08:00 +00:00
juha
2d401fe45a IDE: Support UTF-8 in editor UpperCase/LowerCase Selection commands. Issue #28361, patch from Ondrej Pokorny.
git-svn-id: trunk@49481 -
2015-07-01 09:22:46 +00:00
juha
6cf8c56cfc LazUtils: Improve UTF8WrapText. Issue #28259, patch from Antônio Galvão.
git-svn-id: trunk@49300 -
2015-06-09 07:56:02 +00:00
juha
1568077381 LazUtils: Clean UTF8WrapText function in LazUTF8.
git-svn-id: trunk@49148 -
2015-05-23 14:13:04 +00:00
juha
37ae3c0f43 LazUtils: New UTF8WrapText function for LazUTF8. Issue #28001, patch from Antônio Galvão.
git-svn-id: trunk@48924 -
2015-05-03 10:02:15 +00:00
juha
8250ced275 LazUtils: Use cwstring always with UTF8 RTL on Unix. Does not work without it.
git-svn-id: trunk@48776 -
2015-04-18 10:21:58 +00:00