Bonjour,
Voila j'ai une fonction en C pour coder en coder en quoted printable une chaine de caracteres. Or elle me donne ce resultat dans ma console :
Texte : à é è ç
Texte quoted-printable : =C3=A0 =C3=A9 =C3=A8 =C3=A7

Or les resultats qui sont afficher par des encoder en ligne sur le net sont (affiché sur un navigateur web):
=E0 =E9 =E8 =E7

On remarque la similitude entre les valeurs apres les A et les E.
Voici mon cs :
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
41
42
43
44
45
46
47
48
49
50
51
 
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <limits.h>
 
char * enc_quotedP(char const * string) {
	char * textqp = NULL;
	if (string) {
		fprintf(stdout,"Taille de string : %lu\n",(unsigned long)strlen(string));
		textqp = malloc(3*strlen(string)+1);
		if (textqp) {
			int i=0, j=0;
			unsigned char c = 0u;
			char qp_char[3+1] = { '\0' };
			while(*(string + i) !='\0') {
				if (*(string + i) >= 0  && *(string + i) < SCHAR_MAX) {
   					*(textqp + j) = *(string + i);
					 ++j;
				}
				else {
					c = *(string + i);
					sprintf(qp_char, "=%02X", c);
					strcat(textqp, qp_char);
					j+=3;
				}
 
			++i;
			}
		}
		else {
			fprintf(stderr,"Erreur de Malloc\n");
		}
	}
	return textqp;
}
 
 
int main(void) {
	char * texteQP = NULL; 
	char const * texte; 
	texte = "Les accents : à é è ç"; 
	texteQP = enc_quotedP(texte);
	if (texteQP) {
		fprintf(stdout,"Texte : %s\nTexte quoted-printable : %s\n",texte, texteQP);
	}
	else {
		fprintf(stderr,"Conversion texte -> texteQP a echoue\n");
	}
	return 0;
}
Merci de votre aide,
Ciao,