<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-text-flowed" style="font-family: -moz-fixed;
font-size: 14px;" lang="x-western">Hi again (hopefully the right
place now),
<br>
<br>
I'm thinking about the thread here <a
class="moz-txt-link-freetext"
href="http://forum.lazarus.freepascal.org/index.php/topic,31939.msg206688.html#msg206688"><a class="moz-txt-link-freetext" href="http://forum.lazarus.freepascal.org/index.php/topic,31939.msg206688.html#msg206688">http://forum.lazarus.freepascal.org/index.php/topic,31939.msg206688.html#msg206688</a></a>
where Bart wrote "... and adding explicit codepage identifiers to
sourcecode that has string constants with characters that er not
ASCII (or ad -FcUTF8 to your default compiler options to achieve
the same) ..."
<br>
<br>
I think he is right.
<br>
<br>
Since Lazarus makes per default the switch to UTF-8 encoded
strings, it would be good to hint the developer, that they use
such encoded strings.
<br>
<br>
In the most cases the string magic works without a defined
{$codepage utf8}, but not if you want to assign a const to a
Predefined String or Unicodestring.
<br>
<br>
I add a project that demonstrate, that the assigning of strings
with {$codepage utf8} works better than without it.
<br>
<br>
I would prefer to set {$codepage utf8} per default, if a new
unit/project is created. I like it more than the general switch
-FcUTF8, cause each developer see the current codepage and you can
use units with other codepages too (what in reality probably
nobody would do).
<br>
<br>
I add a possible patch, how I think, it could be.
<br>
<br>
<br>
Offtopic: In the added project: Why is a const 'abc' with
{$codepage UTF8} a Unicodestring (Windows7, 64bit, Lazarus 1.7
r52077M FPC 3.1.1 i386-win32-win32/win64 on FPC 3.1.1 r33371)?
<br>
<br>
<br>
Regards
<br>
<br>
Michl
<br>
</div>
</body>
</html>