Salut à tous,
J'ai un problème avec une fonction que certains d'entre vous utilisant l'ASP peuvent déjà avoir rencontré, qui est la fonction DecodeUTF8.
Voici le corps de la fonction en question :
Le problème est que cette fonction encode bien mes accents à l'intérieur d'une chaine de caractères, mais le dernier accent est remplacé par un point d'interrogation à l'envers...
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 function DecodeUTF8(s) Dim i Dim c Dim n i = 1 do while i <= len(s) c = asc(mid(s,i,1)) if c and &H80 then n = 1 do while i + n < len(s) if (asc(mid(s,i+n,1)) and &HC0) <> &H80 then exit do end if n = n + 1 loop if n = 2 and ((c and &HE0) = &HC0) then c = asc(mid(s,i+1,1)) + &H40 * (c and &H01) else c = 191 end if s = left(s,i-1) + chr(c) + mid(s,i+n) end if i = i + 1 loop DecodeUTF8 = s end function
Quelqun voit-il d'où cela peut venir ?
Merci,
Kelborn
Partager