Commit Graph

105 Commits

Author SHA1 Message Date
florian
84e7a17b67 * patch by Rika: optimize Pos(), resolves #40088 2023-01-23 22:51:40 +01:00
florian
08228d7fb3 * revert a650d346f1 for now as it apparently does
not work with all language encoding
2022-02-26 21:57:42 +01:00
florian
8e4e229a5f + DestSize parameter for fpc_Val_UInt functions 2022-01-11 22:10:26 +01:00
marcoonthegit
4568c77f57 * implemented stringofchar unicodestring, bug #39483 2021-12-14 15:07:43 +01:00
florian
ee10850a57 * patch by Sergey Larin: Reducing and aligning the size of TAnsiRec, TUnicodeRec for CPU64, resolves #38018:
For CPU64, the size of record TAnsiRec and TUnicodeRec is 16 bytes instead of 24.
    Which is very good also because of the alignment. when allocating memory, the address
    of the first character of the string will be aligned on the 16-byte boundary.
    At the same time, the useless Dummy field, which is needed in CPU64 for exactly alignment, has been removed.
    For CPU32 (and CPU16), the record size has not changed, so procedures such as
    fpc_AnsiStr_Decr_Ref, implemented in assembler (see i386, arm), remained working correctly.
  * tests adapted
2021-10-17 11:13:29 +02:00
florian
a5f6505edc * fix range checking for zero based strings, resolves #39323 2021-09-05 21:03:31 +02:00
nickysn
800bb3adc2 * instead of using discardresult, wrap the uniquestring functions in procedures,
that are declared as inline

git-svn-id: trunk@49016 -
2021-03-19 21:13:20 +00:00
michael
257ef24a1e * Fix bug ID #38008: allow UTF8 to unicode conversion to react on/ignore invalid input
git-svn-id: trunk@47391 -
2020-11-12 09:17:09 +00:00
svenbarth
c2454d5386 * fix for Mantis #38023: the code to convert LF to CRLF when converting to UTF-8 is disabled anyway, so disable unnecessary, duplicate if-branches as well
git-svn-id: trunk@47284 -
2020-11-02 16:42:32 +00:00
michael
213d2905df * Change some methods from using var to using out (bug ID 37376)
git-svn-id: trunk@46533 -
2020-08-21 10:44:48 +00:00
yury
0f4ddf7b34 * Do not report about unimplemented unicodestring manager when HAS_WIDESTRINGMANAGER is defined (on Windows). In such case unimplemented parts are never executed unless you call them directly.
* Do not assign DefaultGetStandardCodePage when HAS_WIDESTRINGMANAGER is defined (on Windows).

git-svn-id: trunk@44995 -
2020-04-22 09:13:20 +00:00
svenbarth
48b8110e38 * disable UCS4String if dynamic arrays are disabled
git-svn-id: trunk@42455 -
2019-07-19 11:52:51 +00:00
pierre
819752c334 Avoid warnings when -v0 is used by using $push/$pop
git-svn-id: trunk@41960 -
2019-04-29 14:19:16 +00:00
yury
a19528efa1 * Fixed warnings.
git-svn-id: trunk@40188 -
2018-11-02 19:22:46 +00:00
marco
15fcd0ab61 * remove old ifdefs
git-svn-id: trunk@39642 -
2018-08-19 14:54:58 +00:00
pierre
5cd984b0cb Use RTE 234 insterad of 233 which is for SigQuit in unimplementedunicodestring
git-svn-id: trunk@38588 -
2018-03-21 10:30:26 +00:00
florian
a650d346f1 * optimized for speed UpCase/LowerCase for UnicodeChar, based on a patch by AlexeyT, resolves #32638
git-svn-id: trunk@37625 -
2017-11-26 15:28:45 +00:00
florian
b086b10adf * enable more features for avr6
* ifdef'ed uncompilable procedures

git-svn-id: trunk@37584 -
2017-11-12 22:14:21 +00:00
yury
980c4741ac * Fixed conversion from PWideChar to ansistring.
+ test. 

git-svn-id: trunk@34219 -
2016-07-29 09:43:05 +00:00
svenbarth
a2c9c75e97 Convert Insert() and Delete() to intrinsics in preparation for dynamic array support for these two procedures.
Since overloading compilerprocs does not work each procedure got its own unique name, but they are using the new compilerproc extension to map them to the Insert and Delete symbol so that error messages can be shown with the respective name for the procedure declarations instead of fpc_shortstr_delete for example.

git-svn-id: trunk@33895 -
2016-06-03 21:25:49 +00:00
michael
1bdae1edc8 * Correct comments about sizes/offsets in invisible string header record
git-svn-id: trunk@33247 -
2016-03-13 19:03:40 +00:00
Jonas Maebe
a100309350 * made utf8tostring() Delphi-compatible (mantis #29585):
o removed utf8string overload
   o always ignore any code page information from the input, and interpret the
     contents of the input directly as utf8-encoded bytes
 * made utf8tostring() compatible with the JVM backend (mantis #29497)

git-svn-id: trunk@33159 -
2016-03-05 15:32:22 +00:00
Jonas Maebe
0deacf9fba * fixed missing range checks in r33056
* fixed pos(unicodestring) with a non-zero offset added in r33056 (fixes
    tests/test/units/system/tstring.pp)

git-svn-id: trunk@33120 -
2016-02-25 19:56:49 +00:00
michael
6d051892e5 * Added Offset argument to Pos (exists in wide and ansi/short, forgotten for unicode)
git-svn-id: trunk@33056 -
2016-02-06 12:16:00 +00:00
michael
ee2f34588d * Fix bug #28258, missing UTF8ToString, patch by Stocki
git-svn-id: trunk@32824 -
2016-01-01 17:27:44 +00:00
Jonas Maebe
db2a02fb63 * clarified missing unicodestring manager error message
git-svn-id: trunk@32627 -
2015-12-10 11:00:00 +00:00
michael
fde42ca8ef * Type helpers, compatible to Delphi XE 8
git-svn-id: trunk@32262 -
2015-11-07 09:40:54 +00:00
Jonas Maebe
2afd8eb802 - removed FPC_HAS_STR_CURRENCY-related code, FPC 2.6.4 has it
git-svn-id: trunk@31692 -
2015-09-15 11:51:48 +00:00
Jonas Maebe
85403876cd * fixed UCS4Decode() for #$ffff (patch by Inoussa OUEDRAOGO, mantis #28593)
git-svn-id: trunk@31480 -
2015-09-02 12:10:45 +00:00
Jonas Maebe
cec82a1540 * translate placeholder code page numbers into actual code pages in
fpc_ansistr_to_widechararray(), so that CP_ACP/CP_OEM etc are properly
    handled (fixes assign/assignfile with non-ansi characters in source files
    that don't explicitly specify the code page)

git-svn-id: trunk@29218 -
2014-12-08 12:11:33 +00:00
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
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
Jeppe Johansen
9b79f2f68d Added support for 8-bit CPU's in RTL. Mostly for missing implementations of int<->string conversion and console/text output.
git-svn-id: trunk@26958 -
2014-03-04 20:00:03 +00:00
sergei
0914bb7944 - Removed empty include file wustrings.inc
git-svn-id: trunk@25551 -
2013-09-24 16:35:04 +00:00
Jonas Maebe
3c3ad705f1 * changed fpc_(u)char_to_shortstr() from a procedure into a function, like
the other fpc_(u)char_to_*str() routines (exception dates back to the
    time calls to these routines were still inserted "manually" in the
    compiler). Fixes the compilation of "shortstr:=widecharconstant" after
    r23613 and simplifies other code calling this helper + test

git-svn-id: branches/cpstrrtl@25428 -
2013-09-06 08:02:46 +00:00
Jonas Maebe
d1c36c464a * fixed r22247 so it does in fact set the destination code page properly
(and use the generic helper so no pointer errors can happen)

git-svn-id: branches/cpstrrtl@25141 -
2013-07-19 16:32:29 +00:00
Jonas Maebe
aaa5bb48de + ToSingleByteFileSystemEncodedFileName(array of widechar) overload for more
efficient operation in certain platform's dos units (avoid
    array-of-widechar -> unicodestring conversion)

git-svn-id: branches/cpstrrtl@25138 -
2013-07-19 16:31:21 +00:00
Jonas Maebe
e132a77709 - reverted optimisation from r24962, it's already performed in SetCodePage()
git-svn-id: branches/cpstrrtl@25132 -
2013-07-19 16:28:27 +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
8a4b092ab9 * made ToSingleByteFileSystemEncodedFileName(unicodestring) overridable by
target-specific code and implemented a JVM-compatible version

git-svn-id: branches/cpstrrtl@25001 -
2013-06-27 21:38:17 +00:00
Jonas Maebe
e65d01a717 * small optimisation for ToSingleByteFileSystemEncodedFileName(rawbytestring):
don't call SetCodePage() if the input already has the correct code page
    (SetCodePage would always make the string unique, which is not necessary)

git-svn-id: branches/cpstrrtl@24962 -
2013-06-24 09:40:06 +00:00
Jonas Maebe
980975ff85 * fixed fpc_UnicodeStr_SetLength for 2.6.x bootstrapping
git-svn-id: branches/cpstrrtl@24961 -
2013-06-24 09:40:03 +00:00
Jonas Maebe
3694b4f003 * moved ToSingleByteFileSystemEncodedFileName() to the system unit and
export it so it can be used in all rtl units

git-svn-id: branches/cpstrrtl@24960 -
2013-06-24 09:40:00 +00:00
Jonas Maebe
ecd3cba02b * synchronised with trunk up to r24912
o resolved conflict in updated morphos sysutils unit
   o moved code that had been added to the now deleted  sysunix.inc to the
     unix-specific block of the fpwidestring unit's init code

git-svn-id: branches/cpstrrtl@24913 -
2013-06-17 20:50:02 +00:00
nickysn
cac6ac38d0 + added RTL helpers for Val() for longint/dword on 16/8-bit CPUs
git-svn-id: branches/i8086@24048 -
2013-03-29 01:19:14 +00:00
nickysn
4dfbf148f2 + added Str() helpers for 32-bit ints for 16/8-bit CPUs
git-svn-id: branches/i8086@24008 -
2013-03-25 23:55:47 +00:00
paul
0be1f4d23d rtl: missing FPC_UNICODESTRING_TYPE_DEFINED define
git-svn-id: trunk@23600 -
2013-02-13 00:16:11 +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