Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-10

StringReplace loses non-ASCII characters in FPC 3.1.1

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ondrej Pokorny

Hello!

StringReplace (sysstr.inc) loses non-ASCII characters in FPC 3.1.1:

Whereas in RemS there is correct string:

After Result:=Result+RemS, the "?" gets lost:

BTW I use German Windows 10, so "?" is a character from my ANSI encoding.

I am quite sure it worked before and I couldn't find any change in the SVN so I assume a problem is at my side.
I also use EnableUTF8RTL for LCL - but this should not affect FPC sources, if I am right (and Juha made it by default, now).

I make FPC with this batch script:

@echo on
set mypath=p:\software\FPC\trunk_exp
set mybinutils=p:\software\Lazarus_1_4_2\fpc\2.6.4\bin\i386-win32 cd FPC\trunk_src
p:\software\Lazarus_1_4_2\fpc\2.6.4\bin\i386-win32\make clean all OPT="-gl -O-" FPMAKEOPT="-T 1" NOWPOCYCLE=1
p:\software\Lazarus_1_4_2\fpc\2.6.4\bin\i386-win32\make install INSTALL_PREFIX=%mypath% PP=%mybinutils%\ppc386.exe FPMAKEOPT="-T 1" NOWPOCYCLE=1
cd ..

Do you have any idea what could be wrong?

Ondrej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151020/cbc1ad34/attachment-0001.html> -------------- next part --------------
A non-text attachment was scrubbed...
Name: hbbehcag.png
Type: image/png
Size: 9310 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151020/cbc1ad34/attachment-0002.png> -------------- next part --------------
A non-text attachment was scrubbed...
Name: hdiheaff.png
Type: image/png
Size: 6717 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151020/cbc1ad34/attachment-0003.png>

Reply by email

Juha Manninen
to Ondrej Pokorny
Ondrej Pokorny wrote
SetMultiByteConversionCodePage(CP_UTF8); SetMultiByteRTLFileSystemCodePage(CP_UTF8); helped.

Those functions are already called for you in the initialization section of unit FPCAdds, package LazUtils.
Now it is :

 {$IF (FPC_FULLVERSION >= 30000) AND NOT DEFINED(DisableUTF8RTL)}
 initialization
   SetMultiByteConversionCodePage(CP_UTF8);
   // SetMultiByteFileSystemCodePage(CP_UTF8); not needed, this is the
default under Windows
   SetMultiByteRTLFileSystemCodePage(CP_UTF8);
 {$IFEND}

Earlier it used the EnableUTF8RTL flag.
I guess FPC's automatic rebuild system was confused by the changed defines. Sometimes a clean build is needed.

Juha

Reply by email