Converting from unicode to ASCII

Alex Tweedly alex at tweedly.net
Thu Sep 24 12:54:01 EDT 2020


You could even decide that, rather than strip out non-ascii characters, 
you would convert (reduce?) each one to a canonical equivalent (where 
there is one), and hence instead of

l’Académie française    --->  lAcadmiefranaise_1234.livecode

it would become

l’Académie française    --->  lAcademiefrancaise_1234.livecode

Marginally more readable, and much more typeable :-)

Alex.



On 24/09/2020 17:26, Dave Cragg via use-livecode wrote:
>
> That's what I was thinking. So the filename for " l’Académie française" might becomes something like  lAcadmiefranaise_1234.livecode. Kind of readable, but guaranteed unique. (And also allows identifying the database record from the filename if that is needed.)
>
> (Apologies if this appears twice.)
>
>> I'm pretty sure each record has an ID. This would be for ensuring unique file names, right?
>>
>> --
>> Jacqueline Landman Gay | jacque at hyperactivesw.com
>> HyperActive Software | http://www.hyperactivesw.com
>> On September 24, 2020 2:00:50 AM Dave Cragg via use-livecode <use-livecode at lists.runrev.com> wrote:
>>
>>> Jacqueline,
>>>
>>> You said earlier you don't have a field in the database for the file name. But does the database table have a unique numerical ID field for each record?  If so, could you strip out the non-ASCII characters and then append the numerical ID to the file name?
>>>
>>>> On 23 Sep 2020, at 20:59, J. Landman Gay via use-livecode <use-livecode at lists.runrev.com> wrote:
>>>>
>>>> I'm drifting toward the idea of removing non-ascii characters. That might satisfy all requirements, at least for now. We don't do Sanskrit or Chinese yet. Or alternately I could bite the bullet and convert my build tool to insert metadata into the clickable lists. That isn't terribly difficult, I was just wondering if there was a different way using what we already have.
>>>>
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the use-livecode mailing list