Uploaded image for project: 'iBatis for Java [READ ONLY]'
  1. iBatis for Java [READ ONLY]
  2. IBATIS-784

Resources should use UTF-8 as default encoding

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Critical
    • Resolution: Duplicate
    • 3.0 GA Candidate
    • None
    • Core
    • None
    • WinXP, Java 6

    Description

      If german umlauts appear in the mapper files the the application crashes with an sql exception, because the umlauts are not properly encoded e.g. Pers‚îú√ÇnlicheKontakte instead of PersönlicheKontakte.

      Setting the Charset explicitly to UTF-8 solves this issue.

      [..]
      Resources.setCharset(Charset.forName("UTF-8"));
      reader = Resources.getResourceAsReader(resource);
      SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(reader,props);
      [..]

      Maybe UTF-8 should be set as the default charset not the system charset. After all the xml files are declared as utf-8 in the header.

      Attachments

        Activity

          People

            Unassigned Unassigned
            raupach Björn Raupach
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: