Copy link to clipboard
Copied
Hi All,
We are using InDesignServer CC 2023
In our xml based workflow we are generating actual document after importing an xml.
The issue came up when our incoming xml contents has special character like 'ü', é in it.
e.g
abc.xml has following contents
=====
href="file://%2fVolumes%2ftest%2fimages%2f1000_2000%2f1155_656_%c3%bcsmsung_Galaxy_something.jpg"
here üsmsung_Galaxy_something.jpg = %c3%bcsmsung_Galaxy_something.jpg
=====
an exception gets thrown when we call
objDoc.importXML(abc.xml)
Can anyone suggest how I could fix the issue.
Regards,
Alam
Thanks to all for their valueable reply
We found following when checking file system further
There seems another issue with special character(s) like ü in combination with usage of NFS-volumes.
As Indesign is installed on OSX, it seems OSX uses slightly different encoding type ‘NFD’. Now when files are uploaded via safari, they seem to have ‘NFC’ encoding. (difference is that f.i. ü in NFC this complete character is encoded, while NFD is adding u + encoded ¨).
it is notice that when uploading files
...Copy link to clipboard
Copied
Are you sure it's the problem with the XML contents? Your special characters are converted to ASCII "representation" so it's rather problem with access to the file itself on your drive / network - what exactly is the error you are getting?
Copy link to clipboard
Copied
Hi Robert,
you may be right the problem is with access to file as on network drive we have file at location
/Volumes/test/test2/images/1000_2000/1128_639_üser.png
and its entry in xml file look like
href="file://%2fVolumes%2ftest%2ftest2%2fimages%2f1000_2000%2f1128_639_%c3%bcser.png
but when we do objDoc.importXML(abc.xml) then we are getting exception with message
ReferenceError: User canceled this action
Regards,
Alam
Copy link to clipboard
Copied
Are you on PC or Mac?
On PC paths have "\" not "/".
Copy link to clipboard
Copied
Ok, looks like "/" is OK afterall - but you have 3x of them - "//%2f" - maybe that's the problem?
And you can always try and copy full path to your browser and see if it works.
Copy link to clipboard
Copied
You can use decodeURI() to get the slashes right:
href = "file://" + decodeURI('%2fVolumes%2ftest%2fimages%2f1000_2000%2f1155_656_%c3%bcsmsung_Galaxy_something.jpg') + '"';
depending how you obtain the file name.
Copy link to clipboard
Copied
Thanks to all for their valueable reply
We found following when checking file system further
There seems another issue with special character(s) like ü in combination with usage of NFS-volumes.
As Indesign is installed on OSX, it seems OSX uses slightly different encoding type ‘NFD’. Now when files are uploaded via safari, they seem to have ‘NFC’ encoding. (difference is that f.i. ü in NFC this complete character is encoded, while NFD is adding u + encoded ¨).
it is notice that when uploading files with safari-browser on mac, files have NFC, other browsers on mac use NFD encoding. Probably all windows browsers use NFC.
Copy link to clipboard
Copied
That's why ONLY ASCII characters should be used in the file paths and naming of the files.