Widestrings/fr: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: Widestrings/fr
| Old | New | Line | |
|---|---|---|---|
| 1 | + | ## Widestring | |
| 2 | + | ||
| 3 | + | Une Widestring contient des données de chaînes mais le contenu de cette chaîne est stockée différemment selon le système d'exploitation et la version de FPC. Non-Windows: | |
| 4 | + | ||
| 5 | + | - (FPC 2.2-, 2.4, 2.6): Pur UTF16 (connu comme les widestring de Kylix). | |
| 6 | + | ||
| 7 | + | Windows: | |
| 8 | + | ||
| 9 | + | - FPC 2.2- Pur UTF16 (connu comme les widestring de Kylix). | |
| 10 | + | - FPC 2.4+ bytes encodés UTF16 compatible COM (UCS2 sur Windows 2000). | |
| 11 | + | ||
| 12 | + | Voir [[LCL Unicode Support/fr|Support de l'Unicode par la LCL]] | |
| 13 | + | ||
| 14 | + | ## Ancien contenu | |
| 15 | + | ||
| 16 | + | *Est-ce encore pertient?* --BigChimp 07:59, 23 June 2012 (UTC) Le code suivant de rtl/inc/wstrings.inc est utilisé pour les affectations entre ansistrings et widestrings. | |
| 17 | + | ||
| 18 | + | ``` pascal | |
| 19 | + | procedure Wide2AnsiMove(source:pwidechar;dest:pchar;len:SizeInt); | |
| 20 | + | var | |
| 21 | + | i : SizeInt; | |
| 22 | + | begin | |
| 23 | + | for i:=1 to len do | |
| 24 | + | begin | |
| 25 | + | if word(source^)<128 then | |
| 26 | + | dest^:=char(word(source^)) | |
| 27 | + | else | |
| 28 | + | dest^:=' '; | |
| 29 | + | inc(dest); | |
| 30 | + | inc(source); | |
| 31 | + | end; | |
| 32 | + | end; | |
| 33 | + | ||
| 34 | + | procedure Ansi2WideMove(source:pchar;dest:pwidechar;len:SizeInt); | |
| 35 | + | var | |
| 36 | + | i : SizeInt; | |
| 37 | + | begin | |
| 38 | + | for i:=1 to len do | |
| 39 | + | begin | |
| 40 | + | if byte(source^)<128 then | |
| 41 | + | dest^:=widechar(byte(source^)) | |
| 42 | + | else | |
| 43 | + | dest^:=' '; | |
| 44 | + | inc(dest); | |
| 45 | + | inc(source); | |
| 46 | + | end; | |
| 47 | + | end; | |
| 48 | + | ||
| 49 | + | Const | |
| 50 | + | Wide2AnsiMoveProc:TWide2AnsiMove=@Wide2AnsiMove; | |
| 51 | + | Ansi2WideMoveProc:TAnsi2WideMove=@Ansi2WideMove; | |
| 52 | + | ``` | |
| 53 | + | ||
| 54 | + | Les procvars sont soit-disant là pour vous permettre de les remplacer par un convertisseur plus adapté à votre jeu de caractère local. Malheureusement ils ne permettent pas à l'"ansi" d'être du multi-octet et ils supposent que les ansichars dans les ansistring seront égales au nombre de widechars dans la widestring. | |
| 55 | + | ||
| 56 | + | ## See also | |
| 57 | + | ||
| 58 | + | - [[Character and string types/fr|Types caractère et chaîne]] | |
| 59 | + | ||
| 60 | + | --- | |
| 61 | + | *From the Free Pascal wiki, page "Widestrings/fr", as it stood on 2020-03-04 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
