Xojo Conferences
XDCMay2019MiamiUSA

Re: Non-ascii file names or Shell Command workaround (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: Reading Explorer Shell Thumbnails
Next thread: HTMLViewer, drag and drop, and html alias file


Re: Non-ascii file names or Shell Command workaround   -   Fred Step
  Re: Non-ascii file names or Shell Command workaround   -   D Jungk
  Re: Non-ascii file names or Shell Command workaround   -   Tim Jones
   Re: Non-ascii file names or Shell Command workaround   -   D Jungk
  Re: Non-ascii file names or Shell Command workaround   -   Fred Step
   Re: Non-ascii file names or Shell Command workaround   -   D Jungk
  Re: Non-ascii file names or Shell Command workaround   -   Norman Palardy
   Re: Non-ascii file names or Shell Command workaround   -   D Jungk
   Non-ascii file names or Shell Command workaround   -   D Jungk
    Re: Non-ascii file names or Shell Command workaround   -   joe strout.net
     Re: Non-ascii file names or Shell Command workaround   -   Eric M.Williams
      Re: Non-ascii file names or Shell Command workaround   -   D Jungk
     Re: Non-ascii file names or Shell Command workaround   -   D Jungk
      Re: Non-ascii file names or Shell Command workaround   -   D Jungk
      Re: Non-ascii file names or Shell Command workaround   -   joe strout.net
       Re: Non-ascii file names or Shell Command workaround   -   D Jungk

Re: Non-ascii file names or Shell Command workaround
Date: 02.08.06 09:46 (Wed, 02 Aug 2006 10:46:36 +0200)
From: Fred Step
I'm having a problem retrieving paths. Maybe input and output are linked
The problem for me appears to be with the "locale" that the shell is
using. It seems to be using the "C" settings. I don't know where it's
getting them from because the terminal uses the "fr_FR" that I set in
".bash_profile".

Fred

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Non-ascii file names or Shell Command workaround
Date: 02.08.06 14:43 (Wed, 2 Aug 2006 08:43:03 -0500)
From: D Jungk
On Wednesday 02 August 2006 3:46 am, Fred Step wrote:
> I'm having a problem retrieving paths. Maybe input and output are linked
> The problem for me appears to be with the "locale" that the shell is
> using. It seems to be using the "C" settings. I don't know where it's
> getting them from because the terminal uses the "fr_FR" that I set in
> ".bash_profile".
>
> Fred
>
Hi Fred,
After I asked about the file names here, I started another thread on the RB
Forum about shell paths causing a similar problem. (It's in the "Linux"
section)

I don't understand "C" settings, but William Yu asked me to look in "locale"
and every line in it seems to end in en_US except one line that says
"LC_ALL="

I'm reasonably certain that the RB shell is sending arguments in UTF-8 and the
system is looking for something else. Arguments sent in WindowsAnsi or
ISOLatin1 both work correctly with Spanish accented characters on my Mepis
Linux system.

So far, the only, clumsy, workaround I have found is to write the commands to
a file on the drive in ISOLatin1, set it to be executable and give it a name
with no non-asciis, and the call it from the shell.

Don
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Non-ascii file names or Shell Command workaround
Date: 02.08.06 16:55 (Wed, 2 Aug 2006 08:55:12 -0700)
From: Tim Jones
On Aug 2, 2006, at 6:43 AM, D Jungk wrote:

[SNIP]

> I'm reasonably certain that the RB shell is sending arguments in UTF-8
> and the
> system is looking for something else. Arguments sent in WindowsAnsi or
> ISOLatin1 both work correctly with Spanish accented characters on my
> Mepis
> Linux system.

What happens if you assign the command you want to execute to a string
and then convert the encoding of the string variable before sending it
to the Shell.Execute?

myCommand = "The command to run"
myCommand = ConvertEncoding(myCommand, Encodings.ISOLatin1)
myShell.Execute myCommand

Or maybe even as a single command:

myShell.Execute ConvertEncoding("The command to run",
Encodings.ISOLatin1)

Tim

Re: Non-ascii file names or Shell Command workaround
Date: 02.08.06 19:20 (Wed, 2 Aug 2006 13:20:14 -0500)
From: D Jungk
On Wednesday 02 August 2006 10:55 am, Tim Jones wrote:
> On Aug 2, 2006, at 6:43 AM, D Jungk wrote:
>
> [SNIP]
>
> > I'm reasonably certain that the RB shell is sending arguments in UTF-8
> > and the
> > system is looking for something else. Arguments sent in WindowsAnsi or
> > ISOLatin1 both work correctly with Spanish accented characters on my
> > Mepis
> > Linux system.
>
> What happens if you assign the command you want to execute to a string
> and then convert the encoding of the string variable before sending it
> to the Shell.Execute?
>

>
> Tim
> --
Hi tim,
yes, I did try that and I get exactly the same result. It appears that RB
always converts the encoding to UTF-8

Thanks,,
Don
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Non-ascii file names or Shell Command workaround
Date: 02.08.06 18:54 (Wed, 02 Aug 2006 19:54:57 +0200)
From: Fred Step
Hi Don,

> I don't understand "C" settings, but William Yu asked me to look in "locale"
> and every line in it seems to end in en_US except one line that says
> "LC_ALL="
>
well all of mine end in "C"
> I'm reasonably certain that the RB shell is sending arguments in UTF-8 and the
> system is looking for something else. Arguments sent in WindowsAnsi or
> ISOLatin1 both work correctly with Spanish accented characters on my Mepis
> Linux system.
>
here's what I added and that now works for my French paths and names :
ashell1.writeline "export LANGð_FR;lsof -Fn -p "+pid.text

when I've retrieved the data I convert the UTF8 to Macroman and all is
fine.
So you may want to pass the export LANG the abbrevaition for spanish or
maybe ISO-8859-1 and tag your command converted to UTF8 as the second,
separated as Joe said by a semi colon

hope this helps

Fred
PS if you reply perhaps you could cc me as I'm in digest mode
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Non-ascii file names or Shell Command workaround
Date: 02.08.06 21:33 (Wed, 2 Aug 2006 15:33:18 -0500)
From: D Jungk
On Wednesday 02 August 2006 12:54 pm, Fred Step wrote:
> Hi Don,
>
> here's what I added and that now works for my French paths and names :
> ashell1.writeline "export LANG=fr_FR;lsof -Fn -p "+pid.text
>
> when I've retrieved the data I convert the UTF8 to Macroman and all is
> fine.
> So you may want to pass the export LANG the abbrevaition for spanish or
> maybe ISO-8859-1 and tag your command converted to UTF8 as the second,
> separated as Joe said by a semi colon
>
> hope this helps
>
> Fred

Hi Fred,
Thank you, this does help somewhat. I added a line to .bash_profile and now I
have my system in utf8, which William Yu says is now standard. This will
undoubtedly be better in the long run, but it doesn't help with the paths.

I tried adding the code for Spanish like you suggested above and what this
does is give me the error messages in Spanish. It still says it can't find
files with ñ in the names.

f=GetOpenFolderItem is still returning a nil folderItem which it should never
do.

I have filed two bug reports (folderItems and shell paths), uccfwmsu and
kjhkcrwt , but William says that the shell paths work correctly for him, so
it may be difficult to track down the cause of the problem.

Thank you for your help,
Don
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Non-ascii file names or Shell Command workaround
Date: 02.08.06 21:55 (Wed, 2 Aug 2006 14:55:31 -0600)
From: Norman Palardy

On Aug 02, 2006, at 2:33 PM, D Jungk wrote:

> f=GetOpenFolderItem is still returning a nil folderItem which it
> should never
> do.
>
> I have filed two bug reports (folderItems and shell paths),
> uccfwmsu and
> kjhkcrwt , but William says that the shell paths work correctly for
> him, so
> it may be difficult to track down the cause of the problem.
>
> Thank you for your help,
> Don

This confirmed bug report may give you additional hints.

http://realsoftware.com/feedback/viewreport.php?reportid=obbfaqmi

Various ways of getting new folderitems fail for seemingly random
reasons on Windows and Mac OS X. This may be true on Linux as well
(and seems to be)

I'm running into this with URLPaths like those in the iTunes XML file :(

The file exists but I get a folderItem that says it does not even
though the URLPath is exactly the same
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Non-ascii file names or Shell Command workaround
Date: 02.08.06 23:15 (Wed, 2 Aug 2006 17:15:55 -0500)
From: D Jungk

> This confirmed bug report may give you additional hints.
>
> http://realsoftware.com/feedback/viewreport.php?reportid=obbfaqmi
>
> Various ways of getting new folderitems fail for seemingly random
> reasons on Windows and Mac OS X. This may be true on Linux as well
> (and seems to be)
>
> I'm running into this with URLPaths like those in the iTunes XML file :(
>
> The file exists but I get a folderItem that says it does not even
> though the URLPath is exactly the same
> _______________________________________________
Norman,
Thank you. Looking at your report reminded me that one thing I haven't tried
is using the optional pathtype parameter.

I added this bug report to my list.

Thanks,
Don

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Non-ascii file names or Shell Command workaround
Date: 29.07.06 20:56 (Sat, 29 Jul 2006 14:56:54 -0500)
From: D Jungk
Hi,
I really have looked in the archives, because I know this comes a lot, but I
don't see an answer.

I'm using the Linux IDE, RB2006r3.

What i need to do is display a list and open text files with Spanish names.
With this code:

Dim f as FolderItem

f=GetOpenFolderItem("????")
If f<>nil then
StaticText1.text=f.name
Else
StaticText1.text="Nil"
End If

when I select a file with no non-ascii characters, I see the file name appear
in the window. If I select a file with e.g. ñ or é in the name, I see "Nil".

So, obviously, I can't define or change the encoding after I get the
FolderItem because I'm not getting one.

If I can't do this using FolderItems, it looks like it won't be too difficult
to work around it with Shell commands. The drawback is that it isn't cross
platform.

So, If no one has a solution to the FolderItem way of doing this, can someone
give me the DOS versions of the Linux commands:

ls - List of contents of a directory
ls -l - same, but with more information
file - Gives the file type and text encoding of the file
pager - returns the text from the file.

Thank you,
Don
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Non-ascii file names or Shell Command workaround
Date: 31.07.06 21:26 (Mon, 31 Jul 2006 14:26:23 -0600)
From: joe strout.net
On Jul 29, 2006, at 19:56 UTC, D Jungk wrote:

> I'm using the Linux IDE, RB2006r3.
>
> What i need to do is display a list and open text files with Spanish names.
> With this code:
>
> Dim f as FolderItem
>
> f=GetOpenFolderItem("????")
> If f<>nil then
> StaticText1.textðname
> Else
> StaticText1.text="Nil"
> End If
>
> when I select a file with no non-ascii characters, I see the file name appear
> in the window. If I select a file with e.g. ñ or é in the name, I see "Nil".

If GetOpenFolderItem on Linux is returning Nil for any file contaning non-ASCII characters in its name, I'd say that's a nasty bug. Do you have a feedback ID for it?

Best,
- Joe

--
Jo

Re: Non-ascii file names or Shell Command workaround
Date: 01.08.06 04:06 (Mon, 31 Jul 2006 20:06:49 -0700)
From: Eric M.Williams
On Jul 31, 2006, at 3:32 PM, D Jungk wrote:

> If I try to send a shell command with a path that has ñ or é in it, it
> fails.
> I have tried setting the encoding of a string first and then using
> that in
> the command. It still fails. I can cut the path from the debugger and
> paste
> it into the terminal and it works fine.
>
> There seems to be no way to send a shell command using a path with a
> non-ascii
> in it. My work around so far is to save a text file with the commands
> (with
> proper encoding and permissions) and then call it as a script.

Take a look at 'man xargs'. I use this with AE Monitor and it works
like a charm... except that it's a nasty workaround. :)

Eric M. Williams
Oxalyn Software
http://software.oxalyn.com/

AE Monitor
http://software.oxalyn.com/AEMonitor/

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Non-ascii file names or Shell Command workaround
Date: 01.08.06 14:34 (Tue, 1 Aug 2006 08:34:11 -0500)
From: D Jungk
On Monday 31 July 2006 10:06 pm, Eric M.Williams wrote:
> On Jul 31, 2006, at 3:32 PM, D Jungk wrote:
> > If I try to send a shell command with a path that has ñ or é in it, it
> > fails.
> > I have tried setting the encoding of a string first and then using
> > that in
> > the command. It still fails. I can cut the path from the debugger and
> > paste
> > it into the terminal and it works fine.
> >
> > There seems to be no way to send a shell command using a path with a
> > non-ascii
> > in it. My work around so far is to save a text file with the commands
> > (with
> > proper encoding and permissions) and then call it as a script.
>
> Take a look at 'man xargs'. I use this with AE Monitor and it works
> like a charm... except that it's a nasty workaround. :)
>
> Eric M. Williams
> Oxalyn Software
> http://software.oxalyn.com/
>
Hi Eric,
I looked at "man xargs" and so far I don't quite understand it. Is Standard
Input a file that I put the arguments in before executing the shell command?

Would you have a few minutes to copy a snippet of code that I could look at?

Thank you for your help,

Don Jungk
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Non-ascii file names or Shell Command workaround
Date: 31.07.06 23:32 (Mon, 31 Jul 2006 17:32:07 -0500)
From: D Jungk
On Monday 31 July 2006 3:26 pm, <email address removed> wrote:
> On Jul 29, 2006, at 19:56 UTC, D Jungk wrote:
> > I'm using the Linux IDE, RB2006r3.
> >
> > What i need to do is display a list and open text files with Spanish
> > names. With this code:
> >
> > Dim f as FolderItem
> >
> > f=GetOpenFolderItem("????")
> > If f<>nil then
> > StaticText1.text=f.name
> > Else
> > StaticText1.text="Nil"
> > End If
> >
> > when I select a file with no non-ascii characters, I see the file name
> > appear in the window. If I select a file with e.g. ñ or é in the name,
> > I see "Nil".
>
> If GetOpenFolderItem on Linux is returning Nil for any file contaning
> non-ASCII characters in its name, I'd say that's a nasty bug. Do you have
> a feedback ID for it?
>
> Best,
> - Joe
>
> --
> Joe Strout -- <email address removed>

Yes, it is: uccfwmsu

I've also found something else that I think may be related. My Linux system
seems to be expecting shell commands to be in WindowsAnsi or in ISOLatin1,
but RB seems to be sending them in UTF-8.

If I try to send a shell command with a path that has ñ or é in it, it fails.
I have tried setting the encoding of a string first and then using that in
the command. It still fails. I can cut the path from the debugger and paste
it into the terminal and it works fine.

There seems to be no way to send a shell command using a path with a non-ascii
in it. My work around so far is to save a text file with the commands (with
proper encoding and permissions) and then call it as a script.

I'll have a bug ID for this one tomorrow.

Don
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Non-ascii file names or Shell Command workaround
Date: 01.08.06 14:56 (Tue, 1 Aug 2006 08:56:14 -0500)
From: D Jungk

> >
> > If GetOpenFolderItem on Linux is returning Nil for any file contaning
> > non-ASCII characters in its name, I'd say that's a nasty bug. Do you
> > have a feedback ID for it?
> >
> > Best,
> > - Joe
> >
> > --
> > Joe Strout -- <email address removed>
> Yes, it is: uccfwmsu
>
> I've also found something else that I think may be related. My Linux system
> seems to be expecting shell commands to be in WindowsAnsi or in ISOLatin1,
> but RB seems to be sending them in UTF-8.
>
> If I try to send a shell command with a path that has ñ or é in it, it
> fails. I have tried setting the encoding of a string first and then using
> that in the command. It still fails. I can cut the path from the debugger
> and paste it into the terminal and it works fine.
>
> There seems to be no way to send a shell command using a path with a
> non-ascii in it. My work around so far is to save a text file with the
> commands (with proper encoding and permissions) and then call it as a
> script.
>
> I'll have a bug ID for this one tomorrow.
>
> Don

the bug ID for this one is : kjhkcrwt

Don
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Non-ascii file names or Shell Command workaround
Date: 01.08.06 15:16 (Tue, 1 Aug 2006 08:16:20 -0600)
From: joe strout.net
On Jul 31, 2006, at 22:32 UTC, D Jungk wrote:

> If I try to send a shell command with a path that has ñ or é in it, it fails.
> I have tried setting the encoding of a string first and then using that in
> the command. It still fails.

Just to be clear: you mean *converting* the encoding, not defining it as something it's not, correct?

Best,
- Joe

--
J

Re: Non-ascii file names or Shell Command workaround
Date: 01.08.06 23:05 (Tue, 1 Aug 2006 17:05:19 -0500)
From: D Jungk
On Tuesday 01 August 2006 9:16 am, <email address removed> wrote:
> On Jul 31, 2006, at 22:32 UTC, D Jungk wrote:
> > If I try to send a shell command with a path that has ñ or é in it, it
> > fails. I have tried setting the encoding of a string first and then using
> > that in the command. It still fails.
>
> Just to be clear: you mean *converting* the encoding, not defining it as
> something it's not, correct?
>
> Best,
> - Joe
>
Definitely converting.

Don
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>