unknown encoding error

Discussions on extending SharpCap using the built in Python scripting functionality
Post Reply
michastro
Posts: 19
Joined: Wed Jan 22, 2020 12:10 pm

unknown encoding error

#1

Post 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
User avatar
admin
Site Admin
Posts: 13483
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: unknown encoding error

#2

Post 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
michastro
Posts: 19
Joined: Wed Jan 22, 2020 12:10 pm

Re: unknown encoding error

#3

Post 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
Post Reply