[geotk] Problem with 'copyright' special character when XML marshalling

Emmanuel Blondel emmanuel.blondel1 at gmail.com
Mon Jan 20 07:41:01 PST 2014


Hi Martin, thanks for your prompt reply.
Here attached some code. I have certainly a problem of encoding. Why the 
copyright is not converted to ©? Same question for diacritics (see 
spanish words).

I have difficulties to isolate the issue from the whole, since the issue 
seems at runtime. The application i've built generates a xml from a 
template, afterwhat it publish it to geonetwork. For unknown reasons, 
putting the copyright symbol breaks the publication, as something was 
invalid in the xml. If i separate the 2 actions, first marshall and 
produce the xml, then manually import the xml in Geonetwork, it works. I 
point you to the code i use:
- Metadata (where i use the copyright symbol in a citation template): 
https://github.com/openfigis/gis-tools/blob/master/gis-metadata/gis-metadata/main/src/main/java/org/fao/fi/gis/metadata/GeographicEntityMetadata.java 
(row: 332 - 345)
- publisher (where i marshall to XML and publish the xml to Geonetwork): 
https://github.com/openfigis/gis-tools/blob/master/gis-metadata/gis-metadata/publisher/src/main/java/org/fao/fi/gis/metadata/publisher/MetadataPublisher.java#L67

Emmanuel

Le 20/01/2014 12:46, Martin Desruisseaux a écrit :
> Hello Emmanuel
>
> Thanks for the issue report. Could you send us a small test case that 
> reproduce the problem?
>
>     Martin
>
> Le 20/01/14 12:34, Emmanuel Blondel a écrit :
>> Hi all,
>>
>> I'm currently facing an issue when marshalling a metadata in UTF-8. 
>> Such metadata contains some text content that has the "copyright" symbol.
>> If i put the symbol itself, the XML marshaller does not keep it, and 
>> for strange reason replaces it with the (R) symbol. Apart from this, 
>> this makes raising an exception once i attempt to publish it in the 
>> metadata catalogue. The copyright is not converted to ©
>>
>> Any idea on how i should manage such special character with 
>> geotoolkit metadata?
>>
>> Many thanks in advance
>>
>> Emmanuel
>
>
>
> _______________________________________________
> Geotoolkit mailing list
> Geotoolkit at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geotoolkit


-- 
*Emmanuel Blondel*
GIS Consultant
Engineer in Agronomy & Environment

Geographic Information Systems
in Agronomy - Environment - Fisheries
Email: emmanuel.blondel1 at gmail.com - Emmanuel.Blondel at fao.org
View my LinkedIn profileView my LinkedIn profile 
<http://fr.linkedin.com/in/emmanuelblondel1>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geotoolkit/attachments/20140120/29b552ab/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: btn_in_20x15.png
Type: image/png
Size: 288 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/geotoolkit/attachments/20140120/29b552ab/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: example.java
Type: text/x-java
Size: 1306 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/geotoolkit/attachments/20140120/29b552ab/attachment.java>


More information about the Geotoolkit mailing list