Page 1 of 1

[5.40]RunProgram() with #PB_UTF8

Posted: Tue Nov 17, 2015 12:27 am
by Dadido3
Hi,

just a short bugreport, because it's late here:

When using RunProgram() in an unicode exectuable and you read data from stdin, it's interpreting everything as UTF-8.
That's nice, but the strange part is, that if you add the flag #PB_Program_UTF8 the functions seems to treat the data as #PB_Unicode and vice versa.

A simple example:

Code: Select all

Program = RunProgram("Someprogram.exe", "", "", #PB_Program_Open | #PB_Program_Read) ; Standard string format is UTF-8, as expected
Program = RunProgram("Someprogram.exe", "", "", #PB_Program_Open | #PB_Program_Read | #PB_Ascii) ; Standard string format is ASCII, as expected

Program = RunProgram("Someprogram.exe", "", "", #PB_Program_Open | #PB_Program_Read | #PB_UTF8) ; Standard string format is #PB_Unicode
Program = RunProgram("Someprogram.exe", "", "", #PB_Program_Open | #PB_Program_Read | #PB_Unicode) ; Standard string format is UTF-8

Re: [5.40]RunProgram() with #PB_UTF8

Posted: Tue Nov 17, 2015 9:32 am
by Fred
There problem here is you need to #PB_Program_UTF8, not #PB_UTF8. It's somewhat confusing I agree, so I will move it to feature request to change this in a future version.

Re: [5.40]RunProgram() with #PB_UTF8

Posted: Tue Nov 17, 2015 12:06 pm
by Dadido3
Oh thanks.

I even wrote #PB_Program_UTF8 in the post, because i copied it out of the help, without noticing the additional "_Program" in there.

The moral of the story is "Never program after midnight" :)