| Anonymous | Login | Signup for a new account | 2013-06-20 08:41 CEST | ![]() |
| All Projects | FPC | Lazarus: Packages, Patches | Lazarus CCR | Mantis | fpGUI | fpcprojects: fpprofiler |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||
| 0021986 | FPC | Compiler | public | 2012-05-08 14:41 | 2012-05-08 19:44 | ||||
| Reporter | Thaddy de Koning | ||||||||
| Assigned To | Jonas Maebe | ||||||||
| Priority | normal | Severity | minor | Reproducibility | always | ||||
| Status | closed | Resolution | no change required | ||||||
| Platform | OS | OS Version | |||||||
| Product Version | 2.7.1 | Product Build | 21254 | ||||||
| Target Version | Fixed in Version | ||||||||
| Summary | 0021986: (unicodestring mode) AnsiStrings do not carry codepage info | ||||||||
| Description | Given: ---- {$IFDEF FPC} {$MODE DELPHI} {$MODESWITCH UNICODESTRINGS} {$ENDIF} {$APPTYPE CONSOLE} uses sysutils; var A: AnsiString; F: UTF8String; S: String; begin writeln('compiled with '+{$IFDEF FPC}'FPC'{$ELSE}'Delphi'{$ENDIF}); A:= 'Tiburón'; F:= 'Tiburón'; S:= 'Tiburón'; Writeln('AnsiString: ',A,' ',StringCodePage(A)); Writeln('UTF8String: ',F,' ',StringCodePage(F)); Writeln('Default string: ',S,' ',StringCodePage(S)); readln; end. ----- Expected output (XE2) is: compiled with Delphi AnsiString: Tiburón 1252 UTF8String: Tiburón 65001 Default string: Tiburón 1200 Real output is: compiled with FPC AnsiString: Tiburón 0 UTF8String: Tiburón 65001 Default string: Tiburón 1200 | ||||||||
| Steps To Reproduce | Compile example in Delphi XE2 Compile example with trunk. Compare output | ||||||||
| Tags | No tags attached. | ||||||||
| FPCOldBugId | |||||||||
| Fixed in Revision | |||||||||
| Attached Files | |||||||||
Notes |
|
|
(0059397) Jonas Maebe (manager) 2012-05-08 14:57 edited on: 2012-05-08 15:30 |
{$modeswitch unicodestrings} only changes the default reference counted string type into unicodestring, char into widechar and pchar into pwidechar. The codepage behaviour is influenced by {$modeswitch systemcodepage}. You can use the new {$mode delphiunicode} mode to activate both at the same time (and any future mode switches that may be added for compatibility with Delphi unicode). It is known that currently, on Unix platforms all ansistrings will always have code page 28591 (ISO-8859-1) when using {$modeswitch systemcodepage} and not explicitly setting the code page of the source file. We are still looking in how to solve that. |
|
(0059399) Jonas Maebe (manager) 2012-05-08 14:58 |
And please always mention the OS you used, even if you think it doesn't matter. |
|
(0059410) Thaddy de Koning (reporter) 2012-05-08 19:44 |
I wasn't aware of the codepage switch or the mode delphi unicode. This works indeed as I expected. tnx. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2012-05-08 14:41 | Thaddy de Koning | New Issue | |
| 2012-05-08 14:57 | Jonas Maebe | Status | new => resolved |
| 2012-05-08 14:57 | Jonas Maebe | Resolution | open => no change required |
| 2012-05-08 14:57 | Jonas Maebe | Assigned To | => Jonas Maebe |
| 2012-05-08 14:57 | Jonas Maebe | Note Added: 0059397 | |
| 2012-05-08 14:58 | Jonas Maebe | Note Added: 0059399 | |
| 2012-05-08 15:30 | Jonas Maebe | Note Edited: 0059397 | |
| 2012-05-08 19:44 | Thaddy de Koning | Status | resolved => closed |
| 2012-05-08 19:44 | Thaddy de Koning | Note Added: 0059410 | |
| Main | My View | View Issues | Change Log | Roadmap |



