You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2021/06/11 10:54:00 UTC

[jira] [Commented] (GROOVY-10132) XmlUtil.serialize() Emoji bug

    [ https://issues.apache.org/jira/browse/GROOVY-10132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17361606#comment-17361606 ] 

Paul King commented on GROOVY-10132:
------------------------------------

Are you expecting emoji character to work with UTF-8 encoding?

> XmlUtil.serialize() Emoji  bug
> ------------------------------
>
>                 Key: GROOVY-10132
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10132
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 3.0.8
>         Environment: os : window 10
> jdk : 1.8
> groovy : 3.0.8
>            Reporter: JHPark1
>            Priority: Major
>         Attachments: 캡처.PNG, 캡처1.PNG
>
>
> sorry. I can't Wirte English.
> groovy version : 3.0.8  : not work.
> groovy version : 2.5.14 : work
>  
> Test Code  ;  
> import groovy.xml.XmlSlurper
>  import groovy.xml.XmlUtil
> def xml = '''<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:n="http://shopn.platform.nhncorp.com/"><soapenv:Body><n:GetOptionResponse><n:ResponseType>SUCCESS</n:ResponseType><n:ResponseTime>19</n:ResponseTime><n:Version>2.0</n:Version><n:Timestamp>2021-06-11T05:30:25.55Z</n:Timestamp><Option><n:ProductId>5606052622</n:ProductId><n:SortType>CRE</n:SortType><n:Combination><n:Names><n:Name1>🎁4개이상 구매시 10% 추가할인</n:Name1></n:Names><n:ItemList><n:Item><n:Id>18011522941</n:Id><n:Value1>닭가슴살 11g X 5개입</n:Value1><n:Price>0</n:Price><n:Quantity>99998</n:Quantity><n:Usable>Y</n:Usable></n:Item><n:Item><n:Id>18011522943</n:Id><n:Value1>북어 11g X 5개입</n:Value1><n:Price>0</n:Price><n:Quantity>99999</n:Quantity><n:Usable>Y</n:Usable></n:Item><n:Item><n:Id>18011522945</n:Id><n:Value1>참치 11g X 5개입</n:Value1><n:Price>0</n:Price><n:Quantity>99998</n:Quantity><n:Usable>Y</n:Usable></n:Item><n:Item><n:Id>18011522947</n:Id><n:Value1>열빙어 11g X 5개입</n:Value1><n:Price>0</n:Price><n:Quantity>99998</n:Quantity><n:Usable>Y</n:Usable></n:Item></n:ItemList></n:Combination><n:DeliveryAttribute><n:Type>TODAY</n:Type></n:DeliveryAttribute></Option></n:GetOptionResponse></soapenv:Body></soapenv:Envelope>
>  '''
> def parse = new XmlSlurper().parseText(xml)
>  println(parse) // xml parsing  work.
> def recoverXml = XmlUtil.serialize(parse)
>  println(recoverXml) // error.  ( unicode : 0xd83c error )
>  
>  
> thank.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)