best/fastest way to tell if a field contains unicode text?

Mark Wieder mwieder at ahsoftware.net
Thu Mar 20 21:36:41 EDT 2014


Fraser-

Thursday, March 20, 2014, 10:50:28 AM, you wrote:

> One annoyance is that the unicodeText of a field is not, in fact,
> unicode text in the 7.0 engine - it is binary data. Similarly, the
> uniEncode and uniDecode functions convert between two different
> forms of binary data rather than binary data and text. As uniEncode
> and uniDecode do completely the wrong thing as far as 7.0 is
> concerned, they are deprecated and should be replaced with
> textDecode(binary encoding -> text) and textEncode(text -> binary
> encoding). Again, backwards compatibility.

Thanks. Most of that makes sense, but why not alias the deprecated
uni* functions to text* functions rather than just having them return
the wrong thing?

> In 7.0 you should instead say textEncode("hello bucko", "native")
> and you'll get some nice, 8-bit binary data. Or, if you just pass it
> to something that expects binary data (like a file), it'll get
> converted to 8-bit automatically.

The textEncode function does indeed work as expected. I hadn't checked
out the release notes before trying this.

-- 
-Mark Wieder
 ahsoftware at gmail.com

This communication may be unlawfully collected and stored by the National 
Security Agency (NSA) in secret. The parties to this email do not 
consent to the retrieving or storing of this communication and any 
related metadata, as well as printing, copying, re-transmitting, 
disseminating, or otherwise using it. If you believe you have received 
this communication in error, please delete it immediately.





More information about the use-livecode mailing list