Page 1 of 1

unknown encoding error

Posted: Thu Jul 06, 2023 1:58 pm
by michastro
Hello,
I have a script wich work perfectly when launch via a .bat file:

Code: Select all

"C:\Program Files\SharpCap 4.1 (64 bit)\SharpCap.exe" /runscript "C:\Users\michel\Documents\Sharpcap\Occultation.py"
But, when this .bat is called via NINA, I have this error in the IronPython console:

Code: Select all

Traceback (most recent call last):
  File "<string>", line 1, in <module>
LookupError: unknown encoding: codepage___0
I am a little bit puzzled. For your information, .py is saved in UTF8.
Thanks for your help
Michel

Re: unknown encoding error

Posted: Thu Jul 06, 2023 3:03 pm
by admin
Hi,

weird... Not precisely sure, but a quick web search reveals lots of similar python errors that may be caused by environoment variables or code page settings - ie https://stackoverflow.com/questions/170 ... coding-cp0

I would put two extra lines in your batch file to run 'set' and 'chcp' so you can see what code page and environment variables are set when running the batch file directly and what NINA sets. I expect there is some difference between the two causing this error.

cheers,

Robin

Re: unknown encoding error

Posted: Thu Jul 06, 2023 7:28 pm
by michastro
I have found a solution. I have written a program in Delphi wich call SharpCap via ShellExecute. Now in Nina I call my .exe and not the .bat. Everything
is OK now!! I don't know why, but it doesn't matter.
Thanks
Michel