KDM CLI and character encoding issue

Anything and everything to do with DCP-o-matic.
jakub.krolikowski
Posts: 15
Joined: Tue Feb 18, 2020 8:58 pm

KDM CLI and character encoding issue

Post by jakub.krolikowski »

Hi,
I'm trying to use KDM CLI to generate KDM on Windows but it fails on some non-standard characters:

Code: Select all

dcpomatic2_kdm_cli.exe -o "kdm" -z -f "2022-05-10 00:00:00" -t "2022-06-03 00:00:00" -c "testcinema" -S "1" --certificate "Bielsko-Biała\test-cert.cert.sha256.pem" KDM_kdm_decryption_cert.pem.kdm.xml
"Bielsko-Biała" in the path causes error:

Code: Select all

boost::filesystem::path codecvt to wstring: error
I know I could change the path name to a safe character set ("Bielsko-Biala") but would like to avoid it.
The same error is when non-standard chars are in -c or -S option value.

How should I encode option values?
carl
Site Admin
Posts: 2338
Joined: Thu Nov 14, 2013 2:53 pm

Re: KDM CLI and character encoding issue

Post by carl »

Looks like a bug in DCP-o-matic - there probably isn't a workaround, unfortunately. I'll look into it as soon as I can.
carl
Site Admin
Posts: 2338
Joined: Thu Nov 14, 2013 2:53 pm

Re: KDM CLI and character encoding issue

Post by carl »

Could you please try this version to see if it fixes the bug?
jakub.krolikowski
Posts: 15
Joined: Tue Feb 18, 2020 8:58 pm

Re: KDM CLI and character encoding issue

Post by jakub.krolikowski »

It's better, no errors,
but the name of the output file is not perfect.
For example, -c "białystok biała" gives the kdm file with "biaBystok_biaBa":

KDMInTheMoodForLove_FTR_F_YUE-PL_51_4K_20220218_WMS_SMPTE_VF-JbiaBystok_biaBa1.xml
Carsten
Posts: 2648
Joined: Tue Apr 15, 2014 9:11 pm
Location: Germany

Re: KDM CLI and character encoding issue

Post by Carsten »

You may use non-standard characters in paths/projects (that is DCP-o-matic's responsibility) , but not in any files or names within the DCP. They need to be constrained to a very limited character set. I have seen servers crash hard (system software needed to be reinstalled) with non-standard chars in DCP files/file names.
Last edited by Carsten on Wed May 11, 2022 11:07 am, edited 1 time in total.
carl
Site Admin
Posts: 2338
Joined: Thu Nov 14, 2013 2:53 pm

Re: KDM CLI and character encoding issue

Post by carl »

I was wondering about this ... I think this particular question is about KDM filenames ... do these also need to be constrained?
Carsten
Posts: 2648
Joined: Tue Apr 15, 2014 9:11 pm
Location: Germany

Re: KDM CLI and character encoding issue

Post by Carsten »

I think it's a good idea to constrain everything a server get's to see ;-) I have seen weird things when non-standard chars had been used on ingest material. And while we have control about what DCP-o-matic writes, we have no control at all about server software.
IoannisSyrogiannis
Posts: 128
Joined: Mon Nov 13, 2017 8:40 pm

Re: KDM CLI and character encoding issue

Post by IoannisSyrogiannis »

Judging by experience, servers and media blocks may be gravely affected.
I haven't been witness of software needed to be reinstalled, but I have been witness of media block (IMB to be precise) needing to reboot the projector (IMBs power supply) twice, and the server being incapacitated due to disconnection to the media block. An "i" with an acute accent (í) being the culprit.
So, from then on, I dot all the "i"s and I only horizontally cross all the "t"s...
Now, for a KDM, if the problem is just on the filename, I would rename it before. But why should one have to check? Isn't better safe than sorry?
carl
Site Admin
Posts: 2338
Joined: Thu Nov 14, 2013 2:53 pm

Re: KDM CLI and character encoding issue

Post by carl »

Good points Carsten and Ioannis - thanks. I'll leave the code in to reduce KDM filenames to a very small set of ASCII characters.

@jakub.krolikowski the next version 2.16.11 should fix the transliteration of filenames so that białystok biała becomes bialystok biala instead of biaBystok_biaBa.
Carsten
Posts: 2648
Joined: Tue Apr 15, 2014 9:11 pm
Location: Germany

Re: KDM CLI and character encoding issue

Post by Carsten »

Post Reply