Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert iso-8859 codepage/charset string to another
Message
De
06/10/2006 14:42:04
Emerson Reed
Folhamatic Tecnologia Em Sistemas
Americana - São Paulo, Brésil
 
 
À
05/10/2006 03:12:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01159097
Message ID:
01160178
Vues:
10
Hi Carlos and Juri!
Following your ideas, I developed a function to convert an ISO-8859-1?Q? string that works correctly:
Function CharSetConv
   Lparameters lcText
   Local lcNewText, llConvert, lnPos, lcNewChar
   lcNewText = ""
   llConvert = .F.
   For lnPos=1 To Len(lcText)
      If Upper(Substr(lcText,lnPos,15)) == "=?ISO-8859-1?Q?"
         lnPos = lnPos + 14
         llConvert = .T.
         Loop
      Endif
      If llConvert
         Do Case
            Case Substr(lcText,lnPos,2) == "?="
               lnPos = lnPos + 1
               llConvert = .F.
               Loop
            Case Substr(lcText,lnPos,1) = "="
               lcNewChar = Evaluate("Chr(0x"+Substr(lcText,lnPos+1,2)+")")
               lcNewText = lcNewText + lcNewChar
               lnPos = lnPos + 2
               Loop
            Case Substr(lcText,lnPos,1) = "_"
               lcNewText = lcNewText + Space(1)
               Loop
         Endcase
      Endif
      lcNewText = lcNewText + Substr(lcText,lnPos,1)
   Endfor
   Return lcNewText
Endfunc
But now appear strings encoded in utf-8?b?, utf-8?q?, iso-8859-1?b?, ...

Another idea on how to convert these strings?
Emerson Santon Reed
"One Developer CAN Make a Difference. A community CAN make a future." - Craig Boyd
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform