Page 1 of 2

KDM CLI and character encoding issue

Posted: Sat May 07, 2022 9:47 am
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?

Re: KDM CLI and character encoding issue

Posted: Sun May 08, 2022 8:31 pm
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.

Re: KDM CLI and character encoding issue

Posted: Mon May 09, 2022 9:48 pm
by carl
Could you please try this version to see if it fixes the bug?

Re: KDM CLI and character encoding issue

Posted: Tue May 10, 2022 1:55 pm
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

Re: KDM CLI and character encoding issue

Posted: Tue May 10, 2022 9:56 pm
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.

Re: KDM CLI and character encoding issue

Posted: Tue May 10, 2022 11:10 pm
by carl
I was wondering about this ... I think this particular question is about KDM filenames ... do these also need to be constrained?

Re: KDM CLI and character encoding issue

Posted: Wed May 11, 2022 11:06 am
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.

Re: KDM CLI and character encoding issue

Posted: Wed May 11, 2022 7:22 pm
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?

Re: KDM CLI and character encoding issue

Posted: Wed May 11, 2022 10:57 pm
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.

Re: KDM CLI and character encoding issue

Posted: Wed Jun 22, 2022 10:37 pm
by Carsten