o set the code page of the temporary "text" file to utf-8 for writestr with
unicodestring/widestring as destination, so that no data loss can occur
(+ properly deal with cases whereby part of an utf-8 character is
written to the textbuf in this case)
o explicitly pass the code page of the destination ansistring for writestr
with ansistring as destination and set it for the temporary "text" file
o set the code page of the text file for readstr
git-svn-id: trunk@26317 -
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 -