* imc_channel.hpp: usage of iconv for unix only

* IMCtermite.pyx: add codepage conversion for windows
* bump VERSION
This commit is contained in:
2023-08-08 00:50:52 +02:00
parent 57027e234e
commit 60ac1365a5
3 changed files with 21 additions and 3 deletions

View File

@@ -5,6 +5,16 @@ from IMCtermite cimport cppimctermite
import json as jn
import decimal
import platform
# auxiliary function for codepage conversion
def get_codepage(chn) :
if platform == 'Windows' :
chndec = jn.loads(chn.decode(errors="ignore"))
chncdp = chndec["codepage"]
return 'utf-8' if chncdp is None else chncdp
else :
return 'utf-8'
cdef class imctermite:
@@ -22,7 +32,7 @@ cdef class imctermite:
# get JSON list of channels
def get_channels(self, bool include_data):
chnlst = self.cppimc.get_channels(True,include_data)
chnlstjn = [jn.loads(chn.decode(errors="ignore")) for chn in chnlst]
chnlstjn = [jn.loads(chn.decode(get_codepage(chn),errors="ignore")) for chn in chnlst]
return chnlstjn
# print single channel/all channels

View File

@@ -1 +1 @@
2.0.9
2.0.12