Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's in CURSORTOXML()?
Message
De
22/08/2002 04:02:31
 
 
À
22/08/2002 00:05:37
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Divers
Thread ID:
00692321
Message ID:
00692344
Vues:
27
It won't solve your problem, but may help you to identify its source. This is a replacement for the STRCONV() function (takes a ISO-Latin-1 string and converts it to UFT-8 encoding to be used in XML documents):
FUNCTION IsoToUTF8
LPARAMETERS cIsoLatin1
LOCAL lcIsoLatin1, lcHold, lnLoop, lnLen, lcChar, lcUTF8

lcUTF8 = ""

IF !ISNULL(cIsoLatin1)
  lcIsoLatin1 = STRTRAN(cIsoLatin1,"&","&")
  lcIsoLatin1 = STRTRAN(lcIsoLatin1,"<","&lt;")
  lcIsoLatin1 = STRTRAN(lcIsoLatin1,">","&gt;")
  lcIsoLatin1 = STRTRAN(lcIsoLatin1,"'","&apos;")
  lcIsoLatin1 = STRTRAN(lcIsoLatin1,'"',"&quot;")

  lnLen = LEN(lcIsoLatin1)
  FOR lnLoop = 1 TO lnLen
    lcChar = SUBSTR(lcIsoLatin1,lnLoop,1)
    IF ASC(lcChar)>127
      lcUTF8Char = CHR(BITOR(0xC0,BITAND(0x03,BITRSHIFT(ASC(lcChar),6))))+;
            CHR(BITOR(0x80,BITAND(0x3F,ASC(lcChar))))
      lcUTF8 = lcUTF8+lcUTF8Char
    ELSE
      lcUTF8 = lcUTF8+lcChar
    ENDIF
  ENDFOR
ENDIF

RETURN lcUTF8
----------------------------------
António Tavares Lopes
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform