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

Make GroovyShell read script using specified encoding

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0-beta-10
    • 1.1-rc-2
    • parser
    • None
    • Windows 2000 Pro SP4, Traditional Chinese edition
      J2SDK 1.5.0_02

    Description

      I use groovy template engine to generate reports in different languages such as English, Chinese, Japanese, and Korean. The templates I created are UTF-8 encoded. Currently SimpleTemplateEngine.createTemplate("scriptAsString") invokes GroovyShell.parse(String scriptText) which converts string to a byte array using String.getBytes(). Since I am running Traditional Chinese Windows, getBytes() is equal to getBytes("Big5") and breaks characters in other language like Japanese. To resolve this, the parse() and related methods may need an charset argument or do not convert script to byte array simply using getBytes().

      Attachments

        Activity

          People

            paulk Paul King
            forth Zhenbang Wei
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: