unnecessary conversions between CP_ACP and the current actual
DefaultSystemCodePage
* call TranslatePlaceholderCP() when changing the code page of a
text file because in some cases this code page is passed directly
to widestringmanager.Wide2AnsiMoveProc() (which does not perform any
translation itself)
git-svn-id: trunk@26316 -
+ codepage support for textrec/filerec and the above routines
* textrec/filerec now store the filename by default using widechar. It is
possible to switch back to ansichars using the FPC_ANSI_TEXTFILEREC define.
In that case, from now on the filename will always be stored in
DefaultFileSystemEncoding
* fixed potential buffer overflows and non-null-terminated file names in
textrec/filerec
+ dodirseparators(pwidechar), changed the dodirseparators(pchar/pwidechar)
parameters into var-parameters and gave those routines an extra parameter
that indicates whether the p(wide)char can be changed in place if
necessary or whether a copy must be made first (avoids us having to make
all strings always unique everywhere, because they might be changed on
some platforms via a pchar)
* do_open/do_erase/do_rename got extra boolean parameters indicating whether
the passed pchars point to data that can be freely changed (to pass on to
dodirseparators() if applicable)
* objects.pp: force assign(pchar) to be called, because
assign(array[0..255]) cannot choose between pchar and rawbytestring
versions (and removing the pchar version means that assign(pchar) will
be mapped to assign(shortstring) in {$h-})
* fixed up some routines in other units that depend on the format of
the textrec/filerec.name field
git-svn-id: branches/cpstrrtl@25137 -
* 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 -
- replace ifndef ver2_4 with ifdef FPC_HAS_CPSTRING for places with TextRec.CodePage access
- convert codepages for Read and Write text file operations
git-svn-id: trunk@19545 -
determine the length of a multi-byte character. The return values
are defined to be the same as those of POSIX' mblen: -1 =
invalid/incomplete sequence, 0 = #0, > 0 = length of sequence in
bytes.
+ default implementation for widestringmanager.codepointlengthproc
(assumes all code points have length 1) and Unix implementation
(based on mb(r)len); Windows implementation is still required
* replaced default implementation of
widestringmanager.CharLengthPCharProc with strlen() of the input
instead of an error (correct if all code points have length 1,
still needs Windows implementation)
+ implemented fpc_text_read_{wide,unicode}str() and
fpc_text_read_widechar() (mantis #18163); fpc_text_read_widechar()
uses the new widestringmanager.codepointlengthproc()
+ unicodestring support for readstr/writestr
* fixed declaration of fpc_Write_Text_UnicodeStr (unicodestring
instead of widestring parameter)
* extended test/twide*.pp tests to test the new/fixed functionality
git-svn-id: trunk@16533 -
* text.inc used Std*Handle without checking if the feature CONSOLEIO is present, fixed
* OpenStdIO should use the type THandle for the hdl parameter, fixed
git-svn-id: trunk@16309 -
* changes to alignment for ordinal enumeration value to string accelerator tables so that we can define a single Pascal record to describe them for cleaner code
* some warnings in enumeration rtti generation indicating that if you change the code, you also have to change that in the RTL
* call fpc_shortstr_enum_intern in fpc_write_text_enum instead of copy&paste
* clean up code in fpc_shortstr_enum_intern:
* unify data structures for lookup/search accelerator tables made possible by alignment changes in ncgrtti.pas
* make clear that this is a partial copy&paste of the typinfo unit, also fix some alignment issues by introducing a fake inner record of Tenum_typedata
* temporarily disable range checking for accesses to array[0..0] members of internal data structures
* some documentation
git-svn-id: trunk@16229 -
* correctly write rtti for enumerations (missing alignment instructions on CPUs requiring proper alignment, breaking on architectures with 64 bit pointers)
* fix hardcoded offsets in fpc_write_text_enum
* updated example program
git-svn-id: trunk@10728 -
(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 -