I'm on a Mac, trying to read a UTF-16 encoded xml/text file from my HTML5 extension panel in Premiere Pro CC2017.
If I open the target file in a text editor application (e.g. TextEdit) and resave it with UTF-8 encoding then everything works fine.
Is there any alternative to window.cep.fs.readFile that I can use from my HTML5 extension panel that would allow me to successfully read/convert a UTF-16 encoded file?
Many thanks in advance
Copy link to clipboard
I think readFile can do it; see this blog page about specifying a decode method:
Also useful: CEP HTML Test Extension uses readFile:
Thanks for the quick reply. Yes, that is the sample code I'm working from ... I thought perhaps that it was my implementation of the code but it doesn't even work for me when directly using the 'CEP HTML Test Extension' either.
As a test, please try this yourself if you have the time:
1) Open a Premiere Pro project
2) Create a new Title element
3) Select the Title element in the project window and export it (File > Export) as a Title (.prtl) file.
4) Open the CEP HTML Test Extension and select the Native Functions tab
5) Use File APIs > File Open Dialog to get the path of the Title (.prtl) file you just exported.
6) Use File APIs > Read File with the path to your Title (.prtl) file to read the data
Is the text of your Title (.prtl) file displayed? It's not working here on my iMac ... didn't occur to me that it might be specific to my system/install, but if so, it would certainly explain why I'm having so much trouble with my code!
Thanks again for your pointers Bruce.
Didn't manage to get readFile to work but have implemented a FileReader method instead which seems to be working just fine.
4 years later we are having the same problem. Premiere Pro exports its markers in UTF-16LE but cannot read that file with window.cep.fs.readFile() on a Mac.
How did you solve the problem in your FileReader method?