Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's in CURSORTOXML()?
Message
From
22/08/2002 04:02:31
Antonio Lopes (Online)
BookMARC
Coimbra, Portugal
 
 
To
22/08/2002 00:05:37
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Miscellaneous
Thread ID:
00692321
Message ID:
00692344
Views:
30
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform