Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-10132

XmlUtil.serialize() Emoji bug

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.8
    • 4.0.0-beta-1, 3.0.9
    • None
    • None
    • os : window 10
      jdk : 1.8
      groovy : 3.0.8

    Description

      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.

       

      Attachments

        1. image-2021-06-11-22-19-24-851.png
          0.3 kB
          JHPark1
        2. image-2021-06-11-22-19-36-306.png
          0.3 kB
          JHPark1
        3. 캡처.PNG
          29 kB
          JHPark1
        4. 캡처1.PNG
          115 kB
          JHPark1

        Activity

          People

            paulk Paul King
            Jhpark1 JHPark1
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h