how to uniencode text for VCard v. 3.0? [2]

Horst baleareninsel at gmx.net
Thu Jun 12 02:41:01 EDT 2008


Hi Hugh,

Yes, please sent also a copy to me 

best regards

Horst

Hugh Senior wrote:
> 
> Hi Klaus,
> 
> I just replied totally incorrectly to your UTF-8 query! Must be having a
> bad 
> hair day... My apologies.
> 
> To avoid converting the entire string to UTF8 (when it's only accented
> chars 
> that need it), what I have done is store the decimal/UTF8/Hex character 
> equivalents in a customproperty, then run each element value through this 
> encoder...
> 
> function UTF8.encode tStr
>   put numtochar(13)&numtochar(10) into tCRLF
>   set the itemDel to TAB
>   set the caseSensitive to "TRUE"
>   repeat for each char L in tStr
>     get chartonum(L)
>     if it>=160 then
>       get lineOffset(CR&it&TAB, CR&the UTF8Table of this stack) --| Get
> the 
> table line
>       if it >0 then
>         if VCVERS="2.1" then put toUpper(item 3 of line it of the
> UTF8Table 
> of this stack) after stdout --| Use UTF8
>         else put toUpper(item 2 of line it of the UTF8Table of this stack) 
> after stdout --| Use HEX
>       end if
>     else put L after stdout
>   end repeat
>   replace "\" with "\\" in stdout
>   replace "," with "\," in stdout
>   replace ";" with "\;" in stdout
>   replace CR with "=0D=0A" in stdout --| v2.1 WAB
>   return stdout
> end UTF8.encode
> 
> If the above looks of interest, let me know and I'll send you the look-up 
> table of character equivalents .
> 
> /H 
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 
> 

-- 
View this message in context: http://www.nabble.com/Re%3A-how-to-uniencode-text-for-VCard-v.-3.0---2--tp17782967p17793506.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list