<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hi Steve,
<div class=""><br class="">
</div>
<div class="">Thanks for sending in the report and welcome to the community. I attempted to reproduce the problem but was unable to get the fatal error to occur, my Matlab did seem to use ISO-8859-1 as the default character set though.</div>
<div class=""><br class="">
</div>
<div class="">The dumpXML call should be returning a String from <a href="https://github.com/dgault/ome-common-java/blob/master/src/main/java/loci/common/xml/XMLTools.java#L252" class="">https://github.com/dgault/ome-common-java/blob/master/src/main/java/loci/common/xml/XMLTools.java#L252</a> which
 is set to be encoded with UTF-8 <a href="https://github.com/dgault/ome-common-java/blob/master/src/main/java/loci/common/Constants.java#L40" class="">https://github.com/dgault/ome-common-java/blob/master/src/main/java/loci/common/Constants.java#L40</a>. </div>
<div class="">Do you think it is possible that using char to convert it has changed the encoding? </div>
<div class="">Does setting the character set in Matlab correct it? For example using : feature('DefaultCharacterSet', 'UTF-8’)</div>
<div class=""><br class="">
</div>
<div class="">With Thanks,</div>
<div class="">David Gault</div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 16 Oct 2018, at 17:49, Stephen D. Van Hooser <<a href="mailto:vanhoosr@brandeis.edu" class="">vanhoosr@brandeis.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi all -
<div class=""><br class="">
</div>
<div class="">I'm new to the Open Microscopy effort but it looks really nice, thank you.</div>
<div class=""><br class="">
</div>
<div class="">It's always dangerous to post a bug as one's first message, but I think there's a bug in dumpXML. I'm using Matlab, but it tells me that the object is loci.formats.ome.OMEXMLMetadataImpl</div>
<div class=""><br class="">
</div>
<div class="">If I call </div>
<div class=""><br class="">
</div>
<div class="">r = bfGetReader('~/Downloads/myfile.lif');</div>
<div class="">m=r.getMetadataStore();</div>
<div class="">x = char(m.dumpXML()); % char converts Java string to Matlab character string</div>
<div class="">str2text('myfilename.xml',x); % my own function that simply writes text files
<a href="https://github.com/VH-Lab/vhlab-toolbox-matlab.git" class="">https://github.com/VH-Lab/vhlab-toolbox-matlab.git</a></div>
<div class="">s = xml2struct('myfilename.xml')</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">I get a fatal error because the encoding type described in opening of the xml string in x is UTF-8 but the actual encoding of the document is iso-8859-1. If I edit the x string manually, it can be processed correctly.</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Best</div>
<div class="">Steve</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<br class="">
<br class="">
<div class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space;" class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space;" class="">
<div style="font-family: Helvetica; font-style: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space;" class="">
<span class="" style="float: none; display: inline !important;">------------------------------------------</span><br class="">
<span class="" style="float: none; display: inline !important;">Stephen D. Van Hooser, PhD</span><br class="">
<br class="">
<span class="" style="float: none; display: inline !important;">Associate Professor of Biology</span><br class="">
<span class="" style="float: none; display: inline !important;">Brandeis University</span><br class="">
<span class="" style="float: none; display: inline !important;">781-736-2721 (phone)</span><br class="">
<span class="">{</span><a href="http://www.vhlab.org/" class="">www</a><span class="">,</span><a href="http://wiki.vhlab.org/" class="">wiki</a><span class="">,</span><a href="http://code.vhlab.org/" class="">code</a><span class="">,</span><a href="http://dataclass.vhlab.org/" class="">dataclass</a>,<a href="https://twitter.com/VanHooserLab/" class="">twitter</a><span class="">}.</span><a href="http://vhlab.org/" class="">vhlab.org</a></div>
</div>
</div>
</div>
</div>
</div>
<br class="">
</div>
_______________________________________________<br class="">
ome-users mailing list<br class="">
<a href="mailto:ome-users@lists.openmicroscopy.org.uk" class="">ome-users@lists.openmicroscopy.org.uk</a><br class="">
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
<br>
<span style="font-size:10pt;">The University of Dundee is a registered Scottish Charity, No: SC015096</span>
</body>
</html>