Commit Graph

138 Commits

Author SHA1 Message Date
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
mattias
222321addf lazutils: simplify enableutf8rtl by only using lazutf8
git-svn-id: trunk@47915 -
2015-02-20 14:28:49 +00:00
mattias
e1e00306cf lazutf8: GetFormatSettingsUTF8: map common multibyte chars to ASCII
git-svn-id: trunk@47890 -
2015-02-18 19:51:28 +00:00
mattias
2979c97a9a lazutils: fixed compilation on win64
git-svn-id: trunk@47879 -
2015-02-18 16:52:32 +00:00
mattias
69edc4d8c0 lazutils: moved ReplaceSubString to LazUTF8, added UTF8QuotedStr
git-svn-id: trunk@47748 -
2015-02-13 20:34:21 +00:00
mattias
814cf1a717 lazutils: FindInvalidUTF8Character: check for wrong mapped codes, changed default to report gaps
git-svn-id: trunk@47172 -
2014-12-10 14:26:18 +00:00
mattias
4a8e3ccc51 lazutils: replaced utf8string with string
git-svn-id: trunk@47139 -
2014-12-08 15:50:31 +00:00
mattias
574751850e lazutf8: in utf8 mode: override widestringmanager Ansi procs
git-svn-id: trunk@47108 -
2014-12-04 20:19:50 +00:00
mattias
e2c1838d3d lazutils: sanity check macros
git-svn-id: trunk@47105 -
2014-12-04 18:11:56 +00:00
mattias
2a848a5c8c lazutils: GetEnvironmentStringUTF8 for FPC_RTL_UNICODE
git-svn-id: trunk@47090 -
2014-12-04 14:28:35 +00:00
mattias
1b03376550 lazutils: paswstring: one string less in Wide2AnsiMove and Ansi2WideMove
git-svn-id: trunk@47086 -
2014-12-04 13:44:15 +00:00
mattias
21c8dad40d lazutils: on force CP_UTF8: set argv and formatsettings
git-svn-id: trunk@46997 -
2014-11-26 22:12:50 +00:00
juha
a570fc82eb LazUtils: Override SysToUTF8 and UTF8ToSys with FormatSettings param. Issue #26937, patch from wp.
git-svn-id: trunk@46981 -
2014-11-24 12:17:15 +00:00
mattias
5885982aca lazutils: added WinCPToUTF8 and UTF8ToWinCP
git-svn-id: trunk@46904 -
2014-11-20 15:26:28 +00:00
mattias
9928fb1647 lazutf8: docs
git-svn-id: trunk@46780 -
2014-11-07 16:12:32 +00:00
mattias
5992cb80f4 lazutils: fixed UTF8FindNearestCharStart for 64bit long strings
git-svn-id: trunk@45053 -
2014-05-17 12:05:05 +00:00
bart
2eb279e6e1 LazUtf8: implement Utf8 versions of LeftStr and RightStr.
git-svn-id: trunk@43348 -
2013-11-01 17:40:11 +00:00
mattias
a4a4e4c791 lazutils: small optimization
git-svn-id: trunk@42885 -
2013-09-19 18:36:23 +00:00
bart
7e9930404c LazUtils: better implementation of Utf8StringOfChar. The previously uses conversion to Utf16
only worked if the codepoint was UCS2.

git-svn-id: trunk@42855 -
2013-09-18 10:26:09 +00:00
mattias
37aeda8f7b lazutils: added UTF8StringReplace, feature 22148
git-svn-id: trunk@42707 -
2013-09-09 23:40:04 +00:00
mattias
63ec3d92ee lazutils: clean up
git-svn-id: trunk@42589 -
2013-09-04 09:19:37 +00:00
bart
276a50bbd4 LazUtf8: Utf8StringOfChar: fix compilation error on Darwin.
git-svn-id: trunk@42577 -
2013-09-03 15:18:19 +00:00
bart
eebd3d2f93 LazUtf8: Add routines for padding UTF8 strings:
- Utf8StringOfChar
- Utf8AddChar
- Utf8AddCharR
- Utf8PadLeft
- Utf8PadRight
- Utf8PadCenter

Issue #0024319

git-svn-id: trunk@42575 -
2013-09-03 12:10:41 +00:00
mattias
04ad21f805 lazutils: notes about thread safety
git-svn-id: trunk@41945 -
2013-06-29 17:12:53 +00:00
bart
555ede86aa LazUtils: Move SysErrorMessageUTF8 to LazUtf8 (and inline it in FileUtil).
Part of the ongoing restructuring of LazUtils.

git-svn-id: trunk@41588 -
2013-06-08 14:54:15 +00:00