Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert iso-8859 codepage/charset string to another
Message
 
To
04/10/2006 08:49:58
Emerson Reed
Folhamatic Tecnologia Em Sistemas
Americana - São Paulo, Brazil
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01159097
Message ID:
01159313
Views:
21
Hi Emerson,

You need function for converting to QP (Quoted printable)
lcText=toISO('ěščřž') && convert text to ISO codepage
lcText=ToQP(lcText) && code text to QP
?lcText
?"?=?iso-8859-1?Q?"+lcText+"?=" && get all string by RFC
*********************************************
PROCEDURE ToQP(lcText)
LOCAL lcRet,lcChar,lii,liChar,liEnter,liy
lcRet=""
liEnter=0
FOR lii = 1 TO LEN(lcText)
    lcChar = SUBST(lcText,lii, 1)
    liChar=ASC(lcChar)

    IF (liChar>= 33 AND liChar<= 60) OR (liChar>= 62 AND liChar<= 126)
       lcRet=lcRet+lcChar
       liEnter=liEnter+1
    ELSE
       lcRet=lcRet+"=" + RIGHT(TRANSFORM(liChar,"@0"),2)
       liEnter=liEnter+3
    ENDIF

    IF liEnter=60
       liEnter=0
       lcRet=lcRet+CRLF
    ELSE
       IF liEnter>60
          lcRet=STUFF(lcRet,LEN(lcRet)-2,0,CRLF)
          liEnter=3
       ENDIF
    ENDIF
NEXT
RETURN lcRet
ENDPROC
MartinJ

>Hi Juri!
>Even using this function, I can't get the desired result.
>Maybe I not explain correct what I need.
>
>I'm receiving a string like this:
>=?iso-8859-1?Q?Atualiza=E7=E3o_do_anti-v=EDrus?=
>
>And want to convert this string to:
>Atualização do anti-vírus
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform