Do "Non-Unicode apps" only work with "encoding Plain text"?

Everything else that doesn't fall into one of the other PB categories.
Marco2007
Enthusiast
Enthusiast
Posts: 648
Joined: Tue Jun 12, 2007 10:30 am
Location: not there...

Do "Non-Unicode apps" only work with "encoding Plain text"?

Post by Marco2007 »

Hi,

my app is non-unicode (because I use Gnozal`s PurePop3).
Now I want to use a commandline-tool (with RunProgram()) -> but that tool works only in Unicode-Mode.

I didn`t know, that running a unicode-commandline-app with RunProgram() must be compiled in Unicode-Mode...

Is there something, I can do?

br and thx
Last edited by Marco2007 on Sat Dec 18, 2010 10:07 am, edited 2 times in total.
PureBasic for Windows
User avatar
KJ67
Enthusiast
Enthusiast
Posts: 218
Joined: Fri Jun 26, 2009 3:51 pm
Location: Westernmost tip of Norway

Re: Non-Unicode app -> Can I use Runprogram() in Unicode?

Post by KJ67 »

Peeks() & PokeS() could work for you, they have flags that should let you translate the strings.
The best preparation for tomorrow is doing your best today.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Non-Unicode app -> Can I use Runprogram() in Unicode?

Post by ts-soft »

I think this should work:

Code: Select all

Import "shell32.lib"
  ShellExecuteW(hwnd.i, lpOperation.p-Unicode, lpFile.p-Unicode, lpParameters.p-Unicode, lpDirectory.p-Unicode, nShowCmd.i)
EndImport
Greetings - Thomas
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: Non-Unicode app -> Can I use Runprogram() in Unicode?

Post by Trond »

I don't see why RunProgram() shouldn't work for you. You can run a unicode program with it (from an ascii program).
PMV
Enthusiast
Enthusiast
Posts: 727
Joined: Sat Feb 24, 2007 3:15 pm
Location: Germany

Re: Non-Unicode app -> Can I use Runprogram() in Unicode?

Post by PMV »

do you only need to run the tool or do you need to read output/ write input?
Marco2007
Enthusiast
Enthusiast
Posts: 648
Joined: Tue Jun 12, 2007 10:30 am
Location: not there...

Re: Non-Unicode app -> Can I use Runprogram() in Unicode?

Post by Marco2007 »

Code: Select all

RunProgram("tiff2pdf.exe", "−o "+output$+" "+input$, "")
works only, when I compile in Unicode-mode.
http://www.libtiff.org/
You can run a unicode program with it (from an ascii program).
That`s what I thought, too...

@Thomas: -> also just works, only when Unicode is on...
@KJ67: Let me try...
Last edited by Marco2007 on Fri Dec 17, 2010 11:33 pm, edited 1 time in total.
PureBasic for Windows
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: Non-Unicode app -> Can I use Runprogram() in Unicode?

Post by Trond »

Marco2007 wrote:

Code: Select all

RunProgram("tiff2pdf.exe", "−o "+output$+" "+input$, "")
works only, when I compile in Unicode-mode.
http://www.libtiff.org/
Maybe output$ or input$ contains unicode characters? If the filenames contain unicode characters it won't work in ascii mode.
Marco2007
Enthusiast
Enthusiast
Posts: 648
Joined: Tue Jun 12, 2007 10:30 am
Location: not there...

Re: Non-Unicode app -> Can I use Runprogram() in Unicode?

Post by Marco2007 »

@Trond:
F:\MailBB\IMAGE000.TIF
F:\MailBB\IMAGE000.PDF

....I`m so sad :-(
PureBasic for Windows
Marco2007
Enthusiast
Enthusiast
Posts: 648
Joined: Tue Jun 12, 2007 10:30 am
Location: not there...

Non-Unicode apps have to be compiled with "encoding Plain te

Post by Marco2007 »

Changed Encoding UTF-8 to Encoding Plain Text -> now it works.

Do "Non-Unicode apps" only work with "encoding Plain text" (even when there are no Unicode-chars in the code)?

-> changed Topic-Title.
PureBasic for Windows
Post Reply