Re: Converting from unicode to ASCII

2020-09-22 Thread Richmond Mathewson via use-livecode
"This communication may be unlawfully collected and stored by the Agents of
a large number of governments 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."

Well, after my last posting the Bulgarian government will want my guts for
garters . . . but as the idea of the totally corrupt government wearing
garters made out of my
intestines is hilarious . . .


On Wed, Sep 23, 2020 at 9:19 AM Richmond Mathewson <
richmondmathew...@gmail.com> wrote:

> Personally I think deleting everything that is not inwith the ASCII range
> is potentially a bit dangerous [suppose ALL the letters
> in the title are not inwith the ASCII range], so I would favour using some
> sort of lookup table/substitution list.  Certainly letters such
> as accented 'e' can just be replaced by a 'common or garden e', but,
> consider Cyrillic for instance.  Of course a lot of this has to
> do with what sort of source files you are using [Hmong, anyone?].
>
> Most alphabetic languages have a standardise Latin transliteration
> standard and that is best adhered to, so, for instance:
>
> Ричмънд (in Bulgarian Cyrillic), comes across as 'Richmand' [OK, OK, OK,
> it's hilarious, but that's what you get when a
> transliteration standard is worked out by a committee of people who
> couldn't tie their own shoelaces (that's why they sit in
> committees)].
>
> Certainly, however WONKY a Latin transliteration scheme maybe both
> phonetically and in general, that should NOT need to
> be considered when it comes to file names.
>
> On Wed, Sep 23, 2020 at 6:43 AM Mark Wieder via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>> On 9/22/20 7:58 PM, J. Landman Gay via use-livecode wrote:
>>
>> >> Is this just a temporary filename (not long-term storage)?
>> >
>> > No, the stacks are uploaded to AWS and remain there, retrieved from the
>> > server on request. There are currently hundreds of them with more added
>> > frequently. That's why I'm looking for a solution that doesn't involve
>> > changing all the file names, because renaming and re-uploading all
>> those
>> > files would be way too much work.
>>
>> How do the files get retrieved? Is there a database or something similar
>> that stores the filenames? You could still use UUID filenames from now
>> on and not have to mess with the existing ones.
>>
>> --
>>   Mark Wieder
>>   ahsoftw...@gmail.com
>>
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
> --
>
> This communication may be unlawfully collected and stored by the Agents
> of a large number of governments 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.
>
>

-- 

This communication may be unlawfully collected and stored by the Agents
of a large number of governments 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.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Converting from unicode to ASCII

2020-09-22 Thread Richmond Mathewson via use-livecode
Personally I think deleting everything that is not inwith the ASCII range
is potentially a bit dangerous [suppose ALL the letters
in the title are not inwith the ASCII range], so I would favour using some
sort of lookup table/substitution list.  Certainly letters such
as accented 'e' can just be replaced by a 'common or garden e', but,
consider Cyrillic for instance.  Of course a lot of this has to
do with what sort of source files you are using [Hmong, anyone?].

Most alphabetic languages have a standardise Latin transliteration standard
and that is best adhered to, so, for instance:

Ричмънд (in Bulgarian Cyrillic), comes across as 'Richmand' [OK, OK, OK,
it's hilarious, but that's what you get when a
transliteration standard is worked out by a committee of people who
couldn't tie their own shoelaces (that's why they sit in
committees)].

Certainly, however WONKY a Latin transliteration scheme maybe both
phonetically and in general, that should NOT need to
be considered when it comes to file names.

On Wed, Sep 23, 2020 at 6:43 AM Mark Wieder via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On 9/22/20 7:58 PM, J. Landman Gay via use-livecode wrote:
>
> >> Is this just a temporary filename (not long-term storage)?
> >
> > No, the stacks are uploaded to AWS and remain there, retrieved from the
> > server on request. There are currently hundreds of them with more added
> > frequently. That's why I'm looking for a solution that doesn't involve
> > changing all the file names, because renaming and re-uploading all those
> > files would be way too much work.
>
> How do the files get retrieved? Is there a database or something similar
> that stores the filenames? You could still use UUID filenames from now
> on and not have to mess with the existing ones.
>
> --
>   Mark Wieder
>   ahsoftw...@gmail.com
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


-- 

This communication may be unlawfully collected and stored by the Agents
of a large number of governments 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.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Converting from unicode to ASCII

2020-09-22 Thread J. Landman Gay via use-livecode

On 9/22/20 10:42 PM, Mark Wieder via use-livecode wrote:

On 9/22/20 7:58 PM, J. Landman Gay via use-livecode wrote:

Is this just a temporary filename (not long-term storage)? 


No, the stacks are uploaded to AWS and remain there, retrieved from the server on request. 
There are currently hundreds of them with more added frequently. That's why I'm looking for a 
solution that doesn't involve changing all the file names, because renaming and re-uploading 
all those files would be way too much work.


How do the files get retrieved? Is there a database or something similar that stores the 
filenames? You could still use UUID filenames from now on and not have to mess with the 
existing ones.


I may have misled you. When I said the files were permanent, I meant they stay on the server 
until they get changed, which is fairly regular. They aren't stored on the user's machine where 
tempfile would be, they are downloaded as needed and only kept in memory.


Basically, stacks are named based on a FileMaker database that spits out text files listing 
various properties and content that our app needs to know. Stacks are created by a tool I wrote 
that merges those text files with a stack template to populate the content. The stack name in 
the text file is not only used to create the file name but also appears in several other places 
within the stack (menus, popdown buttons, labels, etc.) The file name is created by munging the 
name string. I'm looking for a way to create non-unicode file names based on the string that 
comes out of the database.


There's more to it than that; the server runs a cron job hourly that indexes all its files and 
creates AWS secure URLs for each. The app downloads that lookup file on demand. When the user 
selects a name from a list, the selection is munged to match the server name and the download 
URL is obtained from the cron job's lookup file.


We don't have a field in the database for a file name. We set up the system this way so we 
could change names when needed, which happens whenever the content and distribution of the 
material changes. Stacks are updated and replaced, sometimes split into two stacks, sometimes 
combined, sometimes rebuilt from scratch. As long as the FM text files contain the right 
string, the app can create the server filename. But the file name needs to be readily 
identifiable so we can manage the replacements on the server easily. If file names were UUIDs, 
wouldn't we still need a way to match the user's selection to a UUID?


When we set this up, we didn't know we were going to go multi-lingual.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Converting from unicode to ASCII

2020-09-22 Thread Mark Wieder via use-livecode

On 9/22/20 7:58 PM, J. Landman Gay via use-livecode wrote:

Is this just a temporary filename (not long-term storage)? 


No, the stacks are uploaded to AWS and remain there, retrieved from the 
server on request. There are currently hundreds of them with more added 
frequently. That's why I'm looking for a solution that doesn't involve 
changing all the file names, because renaming and re-uploading all those 
files would be way too much work.


How do the files get retrieved? Is there a database or something similar 
that stores the filenames? You could still use UUID filenames from now 
on and not have to mess with the existing ones.


--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Converting from unicode to ASCII

2020-09-22 Thread J. Landman Gay via use-livecode

Combining responses:

"NormalizeText" always returns unicode for all four of its variations, so no go. And as Paul 
pointed out, if the language is Chinese, deleting all non-ascii characters would leave nothing. 
On the other hand, we are only converting to Roman languages right now, so this might be a good 
option for a while.


Is this just a temporary filename (not long-term storage)? 


No, the stacks are uploaded to AWS and remain there, retrieved from the server on request. 
There are currently hundreds of them with more added frequently. That's why I'm looking for a 
solution that doesn't involve changing all the file names, because renaming and re-uploading 
all those files would be way too much work.


I hadn't thought about HEX or base64. Those might be options. It would involve more work on my 
client's end though, as she'd need to run each file through a name conversion before uploading.


Still thinking about this.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Converting from unicode to ASCII

2020-09-22 Thread John Balgenorth via use-livecode
You could easily convert it to HEX but that would
make the file name exactly twice as long.

JB

> On Sep 22, 2020, at 4:43 PM, Bob Sneidar via use-livecode 
>  wrote:
> 
> There’s a tempname() function??? Ohhh fun!!
> 
> Bob S
> 
> 
> On Sep 22, 2020, at 4:22 PM, Mark Wieder via use-livecode 
> mailto:use-livecode@lists.runrev.com>> wrote:
> 
> Can you use tempname() to create and retrieve the stack?
> 
> ___
> use-livecode mailing list
> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Converting from unicode to ASCII

2020-09-22 Thread Bob Sneidar via use-livecode
There’s a tempname() function??? Ohhh fun!!

Bob S


On Sep 22, 2020, at 4:22 PM, Mark Wieder via use-livecode 
mailto:use-livecode@lists.runrev.com>> wrote:

Can you use tempname() to create and retrieve the stack?

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


RE: Converting from unicode to ASCII

2020-09-22 Thread Ralph DiMola via use-livecode
How about converting the non ascii characters into to base 64 ascii? This could 
produce really long filenames. I guess you could truncate if needed. Also the 
filename would make no sense at all if it was all non ascii.

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net


-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of 
J. Landman Gay via use-livecode
Sent: Tuesday, September 22, 2020 6:49 PM
To: LiveCode Mailing List
Cc: J. Landman Gay
Subject: Converting from unicode to ASCII

I have a stack with an index. When a user clicks a line, a handler uses the 
clicktext to create a file name which is always the clicktext plus the 
".livecode" extension. The stack is then downloaded from an AWS server and 
displayed.

We are now translating some stacks to other languages which require unicode 
text. AWS recommends not using accented characters in file names, so we need to 
translate the clicktext into plain ASCII.

Is there a good way to do that without using a lookup table or metadata? The 
file names doesn't need to make sense syntactically. For example,

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

...or similar, whatever works. The user will never see the file name.

-- 
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Converting from unicode to ASCII

2020-09-22 Thread Mark Wieder via use-livecode

On 9/22/20 3:48 PM, J. Landman Gay via use-livecode wrote:
I have a stack with an index. When a user clicks a line, a handler uses 
the clicktext to create a file name which is always the clicktext plus 
the ".livecode" extension. The stack is then downloaded from an AWS 
server and displayed.


We are now translating some stacks to other languages which require 
unicode text. AWS recommends not using accented characters in file 
names, so we need to translate the clicktext into plain ASCII.


Is there a good way to do that without using a lookup table or metadata? 
The file names doesn't need to make sense syntactically. For example,


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

...or similar, whatever works. The user will never see the file name.



Is this just a temporary filename (not long-term storage)?
In that case why use the clicktext at all?
Can you use tempname() to create and retrieve the stack?
Or better yet uuid()?

--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Converting from unicode to ASCII

2020-09-22 Thread Paul Dupuis via use-livecode

On 9/22/2020 6:58 PM, Devin Asay via use-livecode wrote:

But it that doesn’t help, and if nobody ever sees the filenames, why not just 
loop through the string and delete anything that’s not in ASCII range?


Well, if the name is in Chinese,  you would delete the entire name.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Converting from unicode to ASCII

2020-09-22 Thread Devin Asay via use-livecode
Hi Jacque,

Have you looked at the normalizeText function? I’m not sure that would help, 
but maybe it’s a start.

But it that doesn’t help, and if nobody ever sees the filenames, why not just 
loop through the string and delete anything that’s not in ASCII range?

Devin

> On Sep 22, 2020, at 4:48 PM, J. Landman Gay via use-livecode 
>  wrote:
> 
> I have a stack with an index. When a user clicks a line, a handler uses the 
> clicktext to create a file name which is always the clicktext plus the 
> ".livecode" extension. The stack is then downloaded from an AWS server and 
> displayed.
> 
> We are now translating some stacks to other languages which require unicode 
> text. AWS recommends not using accented characters in file names, so we need 
> to translate the clicktext into plain ASCII.
> 
> Is there a good way to do that without using a lookup table or metadata? The 
> file names doesn't need to make sense syntactically. For example,
> 
>   l’Académie française -> lAcademiefrancaise.livecode
> 
> ...or similar, whatever works. The user will never see the file name.
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

Devin Asay
Director
Office of Digital Humanities
Brigham Young University

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Converting from unicode to ASCII

2020-09-22 Thread J. Landman Gay via use-livecode
I have a stack with an index. When a user clicks a line, a handler uses the clicktext to create 
a file name which is always the clicktext plus the ".livecode" extension. The stack is then 
downloaded from an AWS server and displayed.


We are now translating some stacks to other languages which require unicode text. AWS 
recommends not using accented characters in file names, so we need to translate the clicktext 
into plain ASCII.


Is there a good way to do that without using a lookup table or metadata? The file names doesn't 
need to make sense syntactically. For example,


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

...or similar, whatever works. The user will never see the file name.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


https put url not working first time

2020-09-22 Thread Ralph DiMola via use-livecode
I'm doing a:

put url (https://somewhere.com/someFolder/file.ext) into url
("file:someLocalPath/file.ext")

 

90% of the time the first try fails but then all similar attempts work 100%
correctly after that.

When it fails the result is empty and the local file has a zero length.

 

Has anyone seen this?

 

LC 9.6.1 business. tsNet is active

 

Thanks

 

Ralph DiMola

IT Director

Evergreen Information Services

rdim...@evergreeninfo.net

 

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Create image from SVG widget

2020-09-22 Thread Klaus major-k via use-livecode
Hi Brian,

> Am 22.09.2020 um 05:38 schrieb Brian Milby via use-livecode 
> :
> 
> Here's a link to the post in the archives:
> http://lists.runrev.com/pipermail/use-livecode/2018-September/250326.html
> 
> I could get close, but still needed to work out a way to translate the path
> to improve upon what was already discussed.  (I can get the actual bounding
> box, but it doesn't really help with eliminating the need to use the cropIt
> handler.)

thank you very much, will take a look!

> On Mon, Sep 21, 2020 at 10:18 PM Brian Milby  wrote:
> 
>> You do not need a file, but you do need additional code.  I found a
>> handler from a Sep 2018 thread that wraps a path to form the input needed
>> for the compile.  LC Mark mentioned an internal call that could enhance the
>> process but I didn’t see any code that leveraged it.  Let me take a crack
>> at it and see what I come up with.
>> 
>> Sent from my iPhone
>> ...
>>> 
 This may be what you're looking for:
 
 put drawingSvgCompile(tFileText) into tDrawing
 set the text of image "svgImage" to tDrawing
 http://forums.livecode.com/viewtopic.php?f=10&t=30441#p163024
 The stack in the forum post will let you see the difference in how a
 particular svg file is rendered in the browser widget, as a SVG path
 (widget), and as a SVG Compiled Drawing (image).  There is some
>> additional
 code available that will translate the path (effectively trim extra
>> space
 around the image) that I have not incorporated.
>>> 
>>> thank you!
>>> 
>>> But I thought we could do this from a SVG widget without the need of a
>> .svg FILE.
>>> Was I dreaming?

Best

Klaus

--
Klaus Major
https://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode