Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting accented chars to Adobe form
Message
From
17/08/2009 16:27:55
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Getting accented chars to Adobe form
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01418540
Message ID:
01418540
Views:
111
Hi all,

Have a function in an app that sends data to an Adobe form via xfdf - basically, an xml text file with tagged fields of data. Am having trouble - the odd time - with some french accented characters not going across to Adobe properly and Adobe choking on parsing the xml file.

Adobe seems to want the text file in UTF-8 encoding so I move through the data to be sent across and for any high-ascii characters, I translate it it UTF-8 as follows (it is a 2 step translation as there does not seem to be a single function call to do it in 1 step).
* (this is in a loop that only translates ascii characters above 128)

   * process: we are using UTF8 character sets in XML but we do not have a function that will translate to that in one sweep
   * so we have to convert first from a single-byte character to a double-byte and then we can go from double-byte to UTF-8)

   STORE STRCONV(lcOldChar,1) TO lcNewChar     && converts from VFP data to DBCS
   STORE STRCONV(lcNewChar,9) TO lcNewChar2     && converts from DBCS to UTF-8

* (replace the character in the string with the new character)
I have tried only converting the VFP character to double-byte (DBCS) i.e. only doing the first translation above, but that did not help. Don't know enough about the encoding to figure this out further. Either the parse chokes or it comes out with the wrong (but sometimes "close" character). The problem character at the moment is the accented capital "A" - ascii 193.

Thanks,
Albsert
Next
Reply
Map
View

Click here to load this message in the networking platform