Bonsoir à tous.
Elle semble fonctionner... aléatoirement !
Et ça me donne ça :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40 Var globales : Chn_Cible_OEM : string; Tab_Chn_Pivot : array[0..255] of char; Surface_Buffer : dword; Ptr_Source : Pointer = nil; Ptr_Tab_Chn_Pivot : Pointer = nil; Chn_Cible_OEM := 'L''évidenéïce de la l'' liberté'; // Volontairement avec caractères NON OEM rajoutés Procedure Appel_Formater_String_OEM; // Ex. de procédure d'appel --------------------------------- Var Long_Chn : integer; begin Chn_Cible_OEM := ''; Chn_Initiale := 'L''évidenéïce de la l'' liberté'; Long_Chn := Length(Chn_Initiale); Chn_Cible_OEM := Chn_Initiale; Formater_String_OEM; Chn_Initiale := Chn_Cible_OEM; Form1.Lab_Aff_Chn_Formatee.Caption := Chn_Cible_OEM; end; Procedure Formater_String_OEM; begin Ptr_Source := @Chn_Cible_OEM[1]; Ptr_Tab_Chn_Pivot := @Tab_Chn_Pivot[0]; Surface_Buffer := Length(Chn_Cible_OEM); CharToOemBuff(Ptr_Source, Ptr_Tab_Chn_Pivot, Surface_Buffer); Chn_Cible_OEM := Tab_Chn_Pivot; end;
Pourquoi le tampon mémoire (ici, le Tab_Chn_Pivot[] ) n'est-il pas correctement traité ? CharToOemBuff, ici, déforme encore plus la chaîne à formater OEM !
Je tourne bourrique, là
Merci :hello:
Partager