Jump to content


Igor Silva

Member Since 29/12/2007
Offline Last Active 31/05/2011, 15:05
-----

Posts I've Made

In Topic: Acento Em Template Flash

29/12/2007, 09:29


O sistema é em ASP e em ASP não há codificadao de string tipo "utf8_decode".

Já tentei setar toda a página como UTF-8 e ainda sim não consegui reoslver o problema no firefox. No internet Explorer funciona perfeitamente.


Hummm bom ai não sei, no PHP tem, ASP não entendo não :(


Bem amigos, o codigo ASP abaixo funcionou comigo.

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© + mid(s,i+n)    end if    i = i + 1  loop  DecodeUTF8 = s end functionfunction EncodeUTF8(s)  dim i  dim c  i = 1  do while i <= len(s)    c = asc(mid(s,i,1))    if c >= &H80 then      s = left(s,i-1) + chr(&HC2 + ((c and &H40) / &H40)) + chr(c and &HBF) + mid(s,i+1)      i = i + 1    end if    i = i + 1  loop  EncodeUTF8 = s end function

Abrçs!
Ps.: é meu 1º post.

IPB Skin By Virteq