Commit Graph

95 Commits

Author SHA1 Message Date
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
Jonas Maebe
598d2feeb6 + rtldefs.inc file for every target that contains defines shared by multiple
RTL units. Comes with a FPCRTL_FILESYSTEM_UTF8 define that can be
    activated for targets whose single byte filesystem interface enforces
    UTF-8; included in inc/systemh.inc and unix/cwstring.pp until now
  + DefaultFileSystemCodePage variable that holds the code page used for
    communicating with the OS single byte file system APIs, and for the
    strings returned by those same APIs. Initialized with
   o the result of GetACP in the system unit of Windows platforms, except for
     WinCE which uses UTF-8 since its file system OS API calls already use
     the UTF-16 versions
   o CP_UTF8 on Unix platforms with FPCRTL_FILESYSTEM_UTF8 defined, and with
     DefaultSystemCodePage on other Unix platforms
   o DefaultSystemCodePage on Java/Android JVM targets
  + DefaultRTLFileSystemCodePage variable that holds the code page used to
    encode strings returned by RTL routines that return filenames obtained
    from OS API calls. By default the same as DefaultFileSystemCodePage on
    all platforms. Separate from DefaultFileSystemCodePage for clarity on
    platforms that may use either utf-16 or single byte OS API calls to
    send/receive file names (such as most Windows platforms)
  + new scpFileSystemSingleByte enum that can be passed to
    GetStandardCodePage() to get the default code page for OS single byte file
    system APIs, with implementations for Unix and Windows
  + SetMultiByteFileSystemCodePage() procedure to override the value of
    DefaultFileSystemCodePage

  In principle, in the long run unchanged programs only using generic
  ansistrings and unicodestrings should (mostly) behave the same as in
  FPC 2.6.0 as far as RTL-level file system APIs are concerned if
  they set DefaultFileSystemCodePage and DefaultRTLFileSystemCodePage
  to DefaultSystemCodePage at the start of their execution

git-svn-id: branches/cpstrrtl@22466 -
2012-09-27 07:54:06 +00:00
Jonas Maebe
e073bf3008 * set destination codepage in DefaultUnicode2AnsiMove
git-svn-id: trunk@22247 -
2012-08-26 14:51:26 +00:00
Jonas Maebe
504544e173 * fixed null-termination in StringToWideChar() if the buffer is larger than
the string (mantis #22669)

git-svn-id: trunk@22124 -
2012-08-19 13:48:02 +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
Jonas Maebe
834026bfb5 * synchronised with trunk up to r21067
git-svn-id: branches/jvmbackend@21068 -
2012-04-26 21:24:20 +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
Jonas Maebe
aee5380ae0 * merged trunk up to r20882
o support for the new codepage-aware ansistrings in the jvm branch
   o empty ansistrings are now always represented by a nil pointer rather than
     by an empty string, because an empty string also has a code page which
     can confuse code (although this will make ansistrings harder to use
     in Java code)
   o more string helpers code shared between the general and jvm rtl
   o support for indexbyte/word in the jvm rtl (warning: first parameter
     is an open array rather than an untyped parameter there, so
     indexchar(pcharvar^,10,0) will be equivalent to
     indexchar[pcharvar^],10,0) there, which is different from what is
     intended; changing it to an untyped parameter wouldn't help though)
   o default() support is not yet complete
   o calling fpcres is currently broken due to limitations in
     sysutils.executeprocess() regarding handling unix quoting and
     the compiler using the same command lines for scripts and directly
     calling external programs
   o compiling the Java compiler currently requires adding ALLOW_WARNINGS=1
     to the make command line

git-svn-id: branches/jvmbackend@20887 -
2012-04-15 15:54:10 +00:00
sergei
180686e429 * Removed 'first' field and 'packed' attribute from TAnsiRec and TUnicodeRec. Removing 'packed' should yield more efficient code on alignment-sensitive targets, while removing 'first' effectively makes two records identical to each other. Further cleanup is possible, but let's see the test suite results before proceeding.
git-svn-id: trunk@20275 -
2012-02-07 16:23:50 +00:00
sergei
a1cb87bcf8 * Improved ucs4 to utf16 conversions: removed function call on every character and multiple memory allocations, made as much code as possible shared between WideString and UnicodeString versions.
git-svn-id: trunk@20270 -
2012-02-06 19:55:56 +00:00
sergei
e94508d5eb * Improved utf16 to ucs4 conversion routines: removed function call on every character, allocate memory once and made as much as possible code shared between WideString and UnicodeString versions.
git-svn-id: trunk@20269 -
2012-02-06 17:55:06 +00:00