High ASCII character translation code thingy

Mark Schonewille m.schonewille at economy-x-talk.com
Sat Nov 29 20:02:52 EST 2008


Hi Paul

This is unicode. Read the text strings from the XML file, then convert  
to unicode.

put uniencode(myXML,"UTF8") into myUnicodeString
set the unicodeText of fld x to myUnicodeString

You might use Rev's XML features to read the data.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
http://economy-x-talk.com
http://www.salery.biz
Dutch forum: http://runrev.info/rrforum

Color Converter has been updated! Get it at
http://colorconverter.economy-x-talk.com !

On 30 nov 2008, at 01:48, paul foraker wrote:

> Hi,
>
> I'm doing some volunteer work for a non-profit. They're sending me  
> an XML
> export from a Netsuite database server, emailed to me weekly. The file
> contains a transaction log which I need to parse in order to update a
> Rev-based database. For ease, and because the file is not huge, I'm  
> opening
> it in Excel, copying the records and pasting them into BBEdit, then  
> saving
> that as ".txt" and reading the text file into Rev. This handily  
> converts the
> data to Tab and Return delimited.
>
> I'm using Macs (Tiger and Leopard, the same behavior). Rev Studio 2.9.
>
> Problem 1:
>
> Some records in this update file contain Spanish, French, German or  
> Dutch
> names, street addresses, etc. The special characters in those  
> languages are
> arriving here in some code that I cannot find a description of  
> anywhere.
> Hopefully, I can represent it here without them getting translated  
> into
> something else.
>
> Example:
>
> The accented i in Maria (María) is expressed in this file as    
> í    or the
> square root symbol and a not-equal sign. So, the result is María.
>
> Question 1: what is this code called, and where can I find some
> documentation on it?  Does Rev have a translator, either through a  
> function,
> or some way to import a file?
>
>
> Problem 2:
>
> A friend painstakingly went through instances of these encodings and  
> mapped
> them to the special characters they represent. So, I now have a text  
> file
> containing a tab and return delimited list, 65 rows. I thought I would
> create an array and pass the data through a function to translate  
> the codes
> into their respective special characters. However, it turns out that  
> one of
> the special characters is a capital D with a horizontal bar through  
> the
> ascender. Or, as it is represented in this table:
>
> √è (tab) Ð
>
> That D character displays fine in BBEdit. However, when I pasted the  
> entire
> list into a Rev field, the data was terminated before displaying  
> that D
> character. I also tried setting a property to the contents of the  
> Clipboard.
> Apparently, that D character is a terminator in the Rev Clipboard.
>
> Question 2: how can I interpret and display the D character, since it
> terminates a string?
>
>
> Weird Note:
>
> I tried using File / Import to bring the translation text file into  
> Rev, but
> that result was surprising. All the characters in the table were  
> translated
> into the very code I'm trying to unravel! So, for example, the line
> containing the accented i:
>
> √≠    í
>
> became
>
> √≠    í
>
> Obviously, Rev knows something about these codes.
>
>
> So, as a workaround, I'm going to replace the D character with a  
> substitute
> and work with the other 64 of them in that array, hoping nobody  
> shows up
> with that D character in their name or address.
>
> Anyone have any insight?
>
> Thanks,
>
> -- Paul




More information about the use-livecode mailing list