Page 1 of 1

sending clip name via osc to resolme character encoding

Posted: Sun Sep 20, 2015 15:12
by Zoltán
I have some problems sending characters above code 127 to the clip name via OSC.
it seems that resolume works well with base characters, but above code 127, produces strange unicode characters, which in turn make Processing XML parser crash with.
Fatal Error] :2185:29: Character reference "&#
org.xml.sax.SAXParseException; lineNumber: 2185; columnNumber: 29; Character reference "&#
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:347)
at processing.data.XML.<init>(XML.java:187)
at processing.core.PApplet.loadXML(PApplet.java:6322)
at processing.core.PApplet.loadXML(PApplet.java:6312)
sending the codes 20 to 256 produce this clip property in the composition:

Code: Select all

 <name value="&#20;&#21;&#22;&#23;&#24;&#25;&#26;&#27;&#28;&#29;&#30;&#31; !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]&#94;_&#96;abcdefghijklmnopqrstuvwxyz{|}~&#127;&#4194242;&#4194176;&#4194242;&#4194177;&#4194242;&#4194178;&#4194242;&#4194179;&#4194242;&#4194180;&#4194242;&#4194181;&#4194242;&#4194182;&#4194242;&#4194183;&#4194242;&#4194184;&#4194242;&#4194185;&#4194242;&#4194186;&#4194242;&#4194187;&#4194242;&#4194188;&#4194242;&#4194189;&#4194242;&#4194190;&#4194242;&#4194191;&#4194242;&#4194192;&#4194242;&#4194193;&#4194242;&#4194194;&#4194242;&#4194195;&#4194242;&#4194196;&#4194242;&#4194197;&#4194242;&#4194198;&#4194242;&#4194199;&#4194242;&#4194200;&#4194242;&#4194201;&#4194242;&#4194202;&#4194242;&#4194203;&#4194242;&#4194204;&#4194242;&#4194205;&#4194242;&#4194206;&#4194242;&#4194207;&#4194242;&#4194208;&#4194242;&#4194209;&#4194242;&#4194210;&#4194242;&#4194211;&#4194242;&#4194212;&#4194242;&#4194213;&#4194242;&#4194214;&#4194242;&#4194215;&#4194242;&#4194216;&#4194242;&#4194217;&#4194242;&#4194218;&#4194242;&#4194219;&#4194242;&#4194220;&#4194242;&#4194221;&#4194242;&#4194222;&#4194242;&#4194223;&#4194242;&#4194224;&#4194242;&#4194225;&#4194242;&#4194226;&#4194242;&#4194227;&#4194242;&#4194228;&#4194242;&#4194229;&#4194242;&#4194230;&#4194242;&#4194231;&#4194242;&#4194232;&#4194242;&#4194233;&#4194242;&#4194234;&#4194242;&#4194235;&#4194242;&#4194236;&#4194242;&#4194237;&#4194242;&#4194238;&#4194242;&#4194239;&#4194243;&#4194176;&#4194243;&#4194177;&#4194243;&#4194178;&#4194243;&#4194179;&#4194243;&#4194180;&#4194243;&#4194181;&#4194243;&#4194182;&#4194243;&#4194183;&#4194243;&#4194184;&#4194243;&#4194185;&#4194243;&#4194186;&#4194243;&#4194187;&#4194243;&#4194188;&#4194243;&#4194189;&#4194243;&#4194190;&#4194243;&#4194191;&#4194243;&#4194192;&#4194243;&#4194193;&#4194243;&#4194194;&#4194243;&#4194195;&#4194243;&#4194196;&#4194243;&#4194197;&#4194243;&#4194198;&#4194243;&#4194199;&#4194243;&#4194200;&#4194243;&#4194201;&#4194243;&#4194202;&#4194243;&#4194203;&#4194243;&#4194204;&#4194243;&#4194205;&#4194243;&#4194206;&#4194243;&#4194207;&#4194243;&#4194208;&#4194243;&#4194209;&#4194243;&#4194210;&#4194243;&#4194211;&#4194243;&#4194212;&#4194243;&#4194213;&#4194243;&#4194214;&#4194243;&#4194215;&#4194243;&#4194216;&#4194243;&#4194217;&#4194243;&#4194218;&#4194243;&#4194219;&#4194243;&#4194220;&#4194243;&#4194221;&#4194243;&#4194222;&#4194243;&#4194223;&#4194243;&#4194224;&#4194243;&#4194225;&#4194243;&#4194226;&#4194243;&#4194227;&#4194243;&#4194228;&#4194243;&#4194229;&#4194243;&#4194230;&#4194243;&#4194231;&#4194243;&#4194232;&#4194243;&#4194233;&#4194243;&#4194234;&#4194243;&#4194235;&#4194243;&#4194236;&#4194243;&#4194237;&#4194243;&#4194238;&#4194243;&#4194239;"/>
I'm stuck, can this be worked around?
I really would like to use éáűőúóü etc characters in clip names via osc.

edit: I tried some online xml validators which show the same error,
Character reference "&#4194243" is an invalid XML character.
So I think the problem is not with the xml parser.

Re: sending clip name via osc to resolme character encoding

Posted: Wed Sep 23, 2015 04:33
by elgarf
Hi.

I think, you must send Unicode or UTF-8 strings via OSC, not strings in your local code page.

Re: sending clip name via osc to resolme character encoding

Posted: Fri Sep 25, 2015 10:36
by Zoltán
I tested this with 2 Resolumes, one sending the file name to the other via osc, the same thing happens, so I would rule out my program as an error source.

Re: sending clip name via osc to resolme character encoding

Posted: Sat Sep 26, 2015 06:04
by elgarf
I meant: you must send
<195 160> bytes for é,
<195 161> for á
and so on.