No problem here:
{$ifdef mswindows}
{$apptype console}
{$endif}
{$ifdef fpc}
{$mode objfpc}
{$h+}
{$codepage utf8}
{$endif}
{$define plainfpc}
uses SysUtils {$ifdef unix},cwstring{$endif};
{$ifdef plainfpc}{$else}{$endif}
var
u8: Utf8String;
s: string;
u: UnicodeString;
begin
{$ifdef plainfpc}
write('Plain Fpc, ');
{$else}
write('Lazarus, ');
{$endif}
{$ifdef windows}
write('Windows ');
{$else}
write('Linux ');
{$endif}
{$ifdef cpu32}
writeln('32-bit');
{$endif}
{$ifdef cpu64}
writeln('64-bit');
{$endif}
writeln('DefaultSystemCodePage = ',DefaultSystemCodePage);
u8 := 'äÄëËïÏöÖüÜ';
s := 'äÄëËïÏöÖüÜ';
u := 'äÄëËïÏöÖüÜ';
writeln('u8 = ',u8,' [cp=',StringCodepage(u8),']');
writeln('s = ',s,' [cp=',StringCodepage(s),']');
writeln('u = ',u,' [cp=',StringCodepage(u),']');
u8 := s;
u := s;
writeln('u8 := s');
writeln('u := s');
writeln('u8 = ',u8,' [cp=',StringCodepage(u8),']');
writeln('u = ',u,' [cp=',StringCodepage(u),']');
u8 := u;
s := u;
writeln('u8 := u');
writeln('s := u');
writeln('u8 = ',u8,' [cp=',StringCodepage(u8),']');
writeln('s = ',s,' [cp=',StringCodepage(s),']');
end.
[bart@localhost ConsoleProjecten]$ fpc test.pas
Free Pascal Compiler version 3.0.0 [2015/11/24] for i386
Copyright (c) 1993-2015 by Florian Klaempfl and others
Target OS: Linux for i386
Compiling test.pas
test.pas(44,8) Warning: Implicit string type conversion from "AnsiString" to "UnicodeString"
test.pas(49,9) Warning: Implicit string type conversion with potential data loss from "UnicodeString" to "UTF8String"
test.pas(50,8) Warning: Implicit string type conversion with potential data loss from "UnicodeString" to "AnsiString"
Linking test
/usr/bin/ld: warning: link.res contains output sections; did you forget -T?
55 lines compiled, 0.4 sec
3 warning(s) issued
[bart@localhost ConsoleProjecten]$ ./test
Plain Fpc, Linux 32-bit
DefaultSystemCodePage = 65001
u8 = äÄëËïÏöÖüÜ [cp=65001]
s = äÄëËïÏöÖüÜ [cp=65001]
u = äÄëËïÏöÖüÜ [cp=1200]
u8 := s
u := s
u8 = äÄëËïÏöÖüÜ [cp=65001]
u = äÄëËïÏöÖüÜ [cp=0]
u8 := u
s := u
u8 = äÄëËïÏöÖüÜ [cp=65001]
s = äÄëËïÏöÖüÜ [cp=65001]
[bart@localhost ConsoleProjecten]$
[bart@localhost ConsoleProjecten]$ locale
LANG=nl_NL.UTF-8
...
Bart