sergei
ae68a4962f
- RTL: merged functionality of InitWideStringManager into InitUnicodeStringManager and removed the former.
...
git-svn-id: trunk@29130 -
2014-11-23 21:09:00 +00:00
Jonas Maebe
ff583bde6c
* made setstring() a compiler intrinsic so it can set the compile-time
...
code page of ansistrings (mantis #26735 )
git-svn-id: trunk@28813 -
2014-10-12 20:27:06 +00:00
sergei
531c2d79e0
- RTL: removed 'unimplementedwidestring' procedure and use 'unimplementedunicodestring' instead. Reduces bloat. Furthermore, a separate message about missing widestring manager is misleading, because there is only one wide/unicodestring manager that can be set.
...
git-svn-id: trunk@27233 -
2014-03-23 02:16:03 +00:00
sergei
54e561dfa4
* Assign CharLengthPCharProc and CodePointLengthProc always in initunicodestringmanager, doing it in initwidestringmanager only complicates things.
...
git-svn-id: trunk@27086 -
2014-03-10 20:18:30 +00:00
Jonas Maebe
a5273abc9c
+ support for CP_OEMCP
...
* changed all mappings from CP_ACP to DefaultSystemCodePage to calls to the
new TranslatePlaceholderCP() routine (which also handles CP_OEMCP)
* removed unnecessary CP_ACP adaptations in fpc_AnsiStr_Concat_multi()
for JVM target (now handled in the ansistring to unicodestring conversion
routine)
git-svn-id: branches/cpstrrtl@25091 -
2013-07-12 17:18:24 +00:00
Jonas Maebe
7c578c3541
* made the pascal name of the string range checking helpers match
...
their assembler name
git-svn-id: trunk@23324 -
2013-01-06 15:05:33 +00:00
Jonas Maebe
fe5a4baa15
- removed FPC 2.4 bootstrapping support
...
git-svn-id: trunk@23321 -
2013-01-06 15:05:20 +00:00
pierre
a311c53167
Replace HandleErrorFrame calls by HandleErrorAddrFrameInd where possible in common code (to allow correct backtrace for mips cpu)
...
git-svn-id: trunk@21900 -
2012-07-12 11:53:59 +00:00
paul
19d1cf9470
rtl: reduce amount of warnings regards implicit string conversions + little formatting
...
git-svn-id: trunk@20925 -
2012-04-19 01:33:47 +00:00
sergei
f07d02b427
- Removed string conversion helpers that are not actually used by compiler code generation (duplicated pwidechar/punicodechar stuff).
...
- Removed one copy of duplicated utf8 encode/decode procedures.
git-svn-id: trunk@20262 -
2012-02-05 18:01:04 +00:00
sergei
8d26b3358f
RTL, wide/unicode strings cleanup:
...
- Removed outdated debugging code
- Removed DefaultWide2AnsiMove, using DefaultUnicode2AnsiMove instead.
- Removed unnecessary operations like SetLength before widestringmanager conversion calls and null-termination afterwards.
- Removed setting pointer to nil after fpc_wide/unicodestr_decr_ref.
git-svn-id: trunk@20231 -
2012-02-03 11:12:25 +00:00
sergei
7ff76caa73
* Removed 'inline' attribute from 6 overloaded pos() functions which contain a managed typecast. Inlining it leads to noticeable increase in code size without any sensible speed improvement.
...
* Added 'const' modifier to the first argument of these functions in order to avoid creating a local copy.
git-svn-id: trunk@20207 -
2012-02-01 13:34:36 +00:00
sergei
009ee271ec
- Cleaned out STR_CONCAT_PROCS define
...
- i386-specific fpc_shortstr_append_shortstr removed too, because a) it was anyway disabled with STR_CONCAT_PROCS, b) the generic implementation is smaller and probably faster due to optimized Move().
git-svn-id: trunk@19867 -
2011-12-17 17:22:18 +00:00
sergei
724f41a9af
- Cleaned out FPC_STRTOSHORTSTRPROC and FPC_STRTOCHARARRAYPROC defines. Somebody had to do it one day.
...
git-svn-id: trunk@19851 -
2011-12-14 22:40:08 +00:00
paul
c1866d5c17
compiler:
...
- don't pass CP_NONE encoding to internal functions. They handled it as 0 encoding. This will optimize the generated code a bit.
- convert all king of string/char/pchar constants to local ansistring def if they needs to be passed to rawbytestring type. They should not get a CP_NONE codepage (delphi compatible)
- don't convert left and right arguments of string concatenation to ansistring type if they are already ansistrings but with different codepage - RTL already handles different codepages in concat routine
- fix resultdef for ansistring concatenations inside assignments - return def of left assignment operand if it is already ansistring - this reduces amount of unneeded condepage conversions since concat functions can return result in any desired codepage
rtl: remove CP_NONE comparisions from most of RTL functions, replace 0 constant with CP_ACP
tests: add test to check various conversions to RawByteString type
git-svn-id: trunk@19519 -
2011-10-20 09:25:51 +00:00
sergei
018fdaf839
- Removed unnecessary operations: SetLength before widestringmanager calls (widestringmanager does the allocation) and zero-termination after SetLength (SetLength does zero-termination).
...
git-svn-id: trunk@19483 -
2011-10-13 17:10:12 +00:00
paul
836889fc64
rtl: move some CP_xxx constants from syswin into systemh for generic use, redeclare UTF8Sting, RawByteString using constant identifiers instead of pure numbers. replace comparison with $ffff codepage to CP_NONE
...
git-svn-id: trunk@19354 -
2011-10-04 05:05:14 +00:00
florian
d7f7a9bb76
* patch by Alexander Shishkin to clean up $ifopt usage by $push/$pop, resolves #20346
...
git-svn-id: trunk@19256 -
2011-09-27 20:22:40 +00:00
sergei
f2852137c8
* DisposeAnsiString doesn't need to exist as a separate procedure, because it is only called from a single place. Merging it into caller yields somewhat more efficient code.
...
* DisposeWideString,DisposeUnicodeString: likewise.
git-svn-id: trunk@19163 -
2011-09-20 18:53:29 +00:00
paul
fd5a15fda5
rtl: manual merge some cpstrnew changes which was impossible to merge using regular tools due to the merge conflicts
...
git-svn-id: trunk@19132 -
2011-09-17 15:39:46 +00:00
florian
f238c9161b
+ declaration of missing BufLen
...
git-svn-id: trunk@19130 -
2011-09-17 15:34:36 +00:00
paul
631c545423
merge r19075 from cpstrnew branch by paul:
...
rtl: change UTF8Decode, UTF8Encode, AnsiToUTF8, UTF8ToAnsi to use RawByteString as arguments/result for compatibility with the old code and also with delphi
git-svn-id: trunk@19128 -
2011-09-17 14:30:17 +00:00
paul
005795495d
merge r17552 from cpstrnew branch by inoussa:
...
*In normal procedure "var" and "out" RawByteString parameters does not accept other string types. Procedures with
"compilerproc" directive or the newly added "rtlproc" directive accept that. Please note that it is up to the
procedure coder to ensure the correctness of the code page in that case. The new directive is needed to handle
the RTL procedures/functions that are not marked as "compilerproc" such as "UniqueString", "Insert" and "Delete".
*Correct "fpc_ansistr_concat" to handle code page correctly.
*Default "ansitring" type is now created with code page set to "0" instead of "65535". Before that change it was
impossible to distinguish a "RawByteString" with the default "ansistring". At runtime "ansistring" variable'code
page is set to DefaultSystemCodePage
*UniqueString flavor of "SetLength" has been updated to release memory when shrinked to at least 50%, like ansitring
does.
git-svn-id: trunk@19118 -
2011-09-17 13:52:09 +00:00
paul
7fd7eee1c9
merge r17330 from cpstrnew branch by michael:
...
* Patch from Inoussa, fixing tunistr1.pp and twide1.pp
git-svn-id: trunk@19107 -
2011-09-17 13:12:07 +00:00
paul
99dae8b97e
merge r16256 from cpstrnew branch by marco:
...
* fix for cycling with 2.4.x
git-svn-id: trunk@19103 -
2011-09-17 12:53:58 +00:00
paul
2162add8ac
merge r14132 from cpstrnew branch by paul:
...
- a set of rtl changes from AnsiString to RawByteString to various conversion functions
- a test which proves output in cp1251 and cp866 codepages (standard for Russian windows)
git-svn-id: trunk@19093 -
2011-09-17 11:39:13 +00:00
paul
8cc22972a0
merge r13488 from cpstrnew branch by florian except ncgcon.pas which has a difficult merge conflict (code moved to another unit which is not at the branch during the revision):
...
* first batch of patches to make tcpstr1.pp work
git-svn-id: trunk@19085 -
2011-09-17 11:16:45 +00:00
paul
ae0d732c8f
merge r13485 from cpstrnew branch by florian:
...
* fixed compilation of system unit after last changes
git-svn-id: trunk@19083 -
2011-09-17 11:01:42 +00:00
paul
28627482c5
merge r13483 from cpstrnew branch by florian:
...
+ Win32Unicode2AnsiMove and Win32Wide2AnsiMove support code page parameter
+ Win32Ansi2UnicodeMove and Win32Ansi2WideMove support code page parameter
+ code page parameter added for several compilerprocs
* unified more code between win32 and win64 (widestring conversion routines
git-svn-id: trunk@19082 -
2011-09-17 10:54:00 +00:00
sergei
829ee9828d
* Added back pre-r17129 configuration of string range check helpers under {$ifdef ver2_4}. Without it, bootstrapping with 2.4.4 and -Cr is broken.
...
git-svn-id: trunk@17715 -
2011-06-11 01:14:01 +00:00
sergei
3e6ad5f5aa
* tcgvecnode, simplified range checking for strings. Removed FPC_*STR_CHECKZERO helpers, and changed FPC_*STR_CHECKRANGE so they accept the original left node. Now strings are checked the same way as dynamic arrays, and the compiler part is considerably simpler.
...
git-svn-id: trunk@17129 -
2011-03-13 15:52:02 +00:00
florian
e99c4d1950
+ support str(<boolean>,...), boolean is an enumeration type
...
* don't run pass_1 on str or val calls in generic method/procedure definitions, resolves #18420
git-svn-id: trunk@16849 -
2011-01-30 14:27:09 +00:00
Jonas Maebe
8c9d0f1f78
* fixed Windows compilation after r16533
...
git-svn-id: trunk@16539 -
2010-12-10 17:27:25 +00:00
sergei
1e11244ddf
* Fix overflow in Delete procedure for Wide- and UnicodeStrings when its Size argument is MaxInt. Now using the same code as in AnsiString version. Mantis #17514 .
...
git-svn-id: trunk@16092 -
2010-10-06 17:31:08 +00:00
florian
7a82669942
* forgotten part of r14432
...
git-svn-id: trunk@14433 -
2009-12-13 11:18:49 +00:00
Jonas Maebe
be39c47d02
* don't stop at #0 characters for setstring with pchar either
...
git-svn-id: trunk@13828 -
2009-10-09 19:47:46 +00:00
Jonas Maebe
6a0755e897
* fixed setstring for unicode/widestring: don't stop at embedded #0
...
characters, don't expect that buffer is null-terminated (mantis #14740 )
git-svn-id: trunk@13826 -
2009-10-09 16:12:03 +00:00
Jonas Maebe
d67dbcf030
* fixed UTF8ToUnicode() based on patch by JoshyFun, and also added
...
support for 4-character UTF-8 codepoints (mantis #11791 )
* fixed UnicodeToUtf8() based on patch by A. J. Miller (mantis
#13075 )
git-svn-id: trunk@12902 -
2009-03-15 15:47:39 +00:00
Jonas Maebe
02bfd45775
* corrected properties
...
git-svn-id: trunk@12900 -
2009-03-15 15:21:17 +00:00
florian
b178b08ba7
Merged revisions 11665-11738 via svnmerge from
...
http://svn.freepascal.org/svn/fpc/branches/unicodestring
........
r11665 | florian | 2008-08-30 13:30:17 +0200 (Sat, 30 Aug 2008) | 1 line
* continued to work on unicodestring type support
........
r11666 | florian | 2008-08-30 19:02:26 +0200 (Sat, 30 Aug 2008) | 2 lines
* expectloc for wide/ansi/unicode strings is LOC_CONSTANT or LOC_REGISTER now
........
r11667 | florian | 2008-08-30 20:42:37 +0200 (Sat, 30 Aug 2008) | 1 line
* more unicodestring stuff fixed, test results on win32 are already good
........
r11670 | florian | 2008-08-30 23:21:48 +0200 (Sat, 30 Aug 2008) | 2 lines
* first fixes for unix bootstrapping
........
r11683 | ivost | 2008-09-01 12:46:39 +0200 (Mon, 01 Sep 2008) | 2 lines
* fixed 64bit bug in iconvenc.pas
........
r11689 | florian | 2008-09-01 23:12:34 +0200 (Mon, 01 Sep 2008) | 1 line
* fixed several errors when building on unix
........
r11694 | florian | 2008-09-03 20:32:43 +0200 (Wed, 03 Sep 2008) | 1 line
* fixed unix compilation
........
r11695 | florian | 2008-09-03 21:01:04 +0200 (Wed, 03 Sep 2008) | 1 line
* bootstrapping fix
........
r11696 | florian | 2008-09-03 21:07:18 +0200 (Wed, 03 Sep 2008) | 1 line
* more bootstrapping fixed
........
r11698 | florian | 2008-09-03 22:47:54 +0200 (Wed, 03 Sep 2008) | 1 line
+ two missing compiler procs exported
........
r11701 | florian | 2008-09-04 16:42:34 +0200 (Thu, 04 Sep 2008) | 2 lines
+ lazarus project for the linux rtl
........
r11702 | florian | 2008-09-04 16:43:27 +0200 (Thu, 04 Sep 2008) | 2 lines
+ set unicode string procedures
........
r11707 | florian | 2008-09-04 23:23:02 +0200 (Thu, 04 Sep 2008) | 2 lines
* fixed several type casting stuff
........
r11712 | florian | 2008-09-05 22:46:03 +0200 (Fri, 05 Sep 2008) | 1 line
* fixed unicodestring compilation on windows after recent unix changes
........
r11713 | florian | 2008-09-05 23:35:12 +0200 (Fri, 05 Sep 2008) | 1 line
+ UnicodeString support for Variants
........
r11715 | florian | 2008-09-06 20:59:54 +0200 (Sat, 06 Sep 2008) | 1 line
* patch by Martin Schreiber for UnicodeString streaming
........
r11716 | florian | 2008-09-06 22:22:55 +0200 (Sat, 06 Sep 2008) | 2 lines
* fixed test
........
r11717 | florian | 2008-09-07 10:25:51 +0200 (Sun, 07 Sep 2008) | 1 line
* fixed typo when converting tunicodestring to punicodechar
........
r11718 | florian | 2008-09-07 11:29:52 +0200 (Sun, 07 Sep 2008) | 3 lines
* fixed writing of UnicodeString properties
* moved some helper routines to unicode headers
........
r11734 | florian | 2008-09-09 22:38:55 +0200 (Tue, 09 Sep 2008) | 1 line
* fixed bootstrapping
........
r11735 | florian | 2008-09-10 11:25:28 +0200 (Wed, 10 Sep 2008) | 2 lines
* first fixes for persisten unicodestrings
........
r11736 | florian | 2008-09-10 14:31:00 +0200 (Wed, 10 Sep 2008) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-11663" from
http://svn.freepascal.org/svn/fpc/trunk
........
r11737 | florian | 2008-09-10 21:06:57 +0200 (Wed, 10 Sep 2008) | 3 lines
* fixed unicodestring <-> variant handling
* fixed unicodestring property reading
........
git-svn-id: trunk@11739 -
2008-09-10 20:14:31 +00:00
florian
891ce34513
* preparations for unicodestring support in the rtl
...
git-svn-id: trunk@9386 -
2007-12-02 22:33:56 +00:00
yury
e62c6cfcc4
* Fixed warnings and notes.
...
git-svn-id: trunk@9041 -
2007-11-01 14:16:43 +00:00
florian
1bbe6565b0
* fixes widestring range checking, resolves #10013
...
git-svn-id: trunk@8971 -
2007-10-28 14:46:41 +00:00
florian
7878f0feb3
* made all fpc_*_to_shortstr helpers a procedure, resolves #8580
...
git-svn-id: trunk@8898 -
2007-10-21 17:33:18 +00:00
yury
685810c18c
* Fixed fpc_WideCharArray_To_WideStr in case if widechar array contains empty string.
...
+ Test.
git-svn-id: trunk@8317 -
2007-08-28 09:53:29 +00:00
Jonas Maebe
815cd2b39d
+ support for widestring manager based widechar conversions
...
(widechar<->char, widechar<>*string), based on patch from
Rimgaudas Laucius (mantis #7758 )
* no longer perform compile-time widechar/string->char/ansi/
shortstring conversions if they would destroy information
(they can't cope with widechars with ord>=128). This means
that you can now properly constant widechars/widestrings
in source code with a {$codepage } set without risking that
the compiler will mangle everything afterwards
* support ESysEINVAL return code from iconv (happens if last
multibyte char is incomplete)
* fixed writing of widechars (were converted to char -> lost
information)
git-svn-id: trunk@8274 -
2007-08-12 20:01:08 +00:00
Almindor
fdecceebd0
* fix UnicodeToUtf8 if Dest is nil, patch by Sergei Gorelkin
...
git-svn-id: trunk@8078 -
2007-07-16 18:24:32 +00:00
yury
55d6a37865
* Fixed bug #9221 .
...
+ Test.
git-svn-id: trunk@7975 -
2007-07-07 17:37:34 +00:00
yury
8a0cc8c888
* Reallocate source winlike widestring on assign. It fixes bug #9190 .
...
* Error handling on allocating winlike widestring.
+ Test.
git-svn-id: trunk@7917 -
2007-07-01 21:57:39 +00:00
yury
ec2d657a32
* Small addition to r7911.
...
git-svn-id: trunk@7914 -
2007-07-01 20:29:01 +00:00