You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Ralf Assmann (JIRA)" <ib...@incubator.apache.org> on 2006/09/04 09:17:22 UTC

[jira] Created: (IBATIS-340) Loading Resources With Different Charsets

Loading Resources With Different Charsets
-----------------------------------------

                 Key: IBATIS-340
                 URL: http://issues.apache.org/jira/browse/IBATIS-340
             Project: iBatis for Java
          Issue Type: Bug
            Reporter: Ralf Assmann




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (IBATIS-340) Loading Resources With Different Charsets

Posted by "Ralf Assmann (JIRA)" <ib...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/IBATIS-340?page=comments#action_12432462 ] 
            
Ralf Assmann commented on IBATIS-340:
-------------------------------------

The first Resources.java contains an error, it does not work in this way. So, please take the second one as example ...



> Loading Resources With Different Charsets
> -----------------------------------------
>
>                 Key: IBATIS-340
>                 URL: http://issues.apache.org/jira/browse/IBATIS-340
>             Project: iBatis for Java
>          Issue Type: Bug
>            Reporter: Ralf Assmann
>         Attachments: Resources.java, Resources.java
>
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (IBATIS-340) Loading Resources With Different Charsets

Posted by "Ralf Assmann (JIRA)" <ib...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/IBATIS-340?page=comments#action_12432463 ] 
            
Ralf Assmann commented on IBATIS-340:
-------------------------------------

The second one is this with the size of 11 kb.

> Loading Resources With Different Charsets
> -----------------------------------------
>
>                 Key: IBATIS-340
>                 URL: http://issues.apache.org/jira/browse/IBATIS-340
>             Project: iBatis for Java
>          Issue Type: Bug
>            Reporter: Ralf Assmann
>         Attachments: Resources.java, Resources.java
>
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (IBATIS-340) Loading Resources With Different Charsets

Posted by "Ralf Assmann (JIRA)" <ib...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/IBATIS-340?page=comments#action_12432440 ] 
            
Ralf Assmann commented on IBATIS-340:
-------------------------------------

For loading resources, ibatis will use the class com.ibatis.common.resources.Resources. Using this class, there will be a problem loading resources on a different environment than the code has been deployed on. E.g., if the code is deployed on an Windows computer, but it runs on an AIX, there is a problem loading the resources.

The problem exists because of different charset on different environments. For loading the first xml-file sqlMapConfix.xml (which will be given to SqlMapClientBuilder.buildSqlMapClient(...)), this problem can be solved by using a different loader. But after that, ibatis will load more xml-files, the ones which are defined in the first one, using tags <sqlMap resource=...>. Here, ibatis uses getResourceAsReader(...) from the Resources-class - and then it will not work.

A solution could be telling the Resources-class, which charset should be used. In the attached file to this issue, this has been done by adding a property-attribute. A CHARSET can be added to this property-list, using the method addProperty(...). If calling getResourceAsReader(...) from the Resource-class, if is looked up if a property CHARSET exists. If yes, this will be used creating the new InputStreamReader ...

> Loading Resources With Different Charsets
> -----------------------------------------
>
>                 Key: IBATIS-340
>                 URL: http://issues.apache.org/jira/browse/IBATIS-340
>             Project: iBatis for Java
>          Issue Type: Bug
>            Reporter: Ralf Assmann
>         Attachments: Resources.java
>
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (IBATIS-340) Loading Resources With Different Charsets

Posted by "Jeff Butler (JIRA)" <ib...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/IBATIS-340?page=all ]

Jeff Butler closed IBATIS-340.
------------------------------

    Fix Version/s: 2.3.0
       Resolution: Fixed

Fixed in SVN.

I took a little different approach... added a setCharset(Charset charset) method, but the idea is basically the same.  Thanks for the suggestion!


> Loading Resources With Different Charsets
> -----------------------------------------
>
>                 Key: IBATIS-340
>                 URL: http://issues.apache.org/jira/browse/IBATIS-340
>             Project: iBatis for Java
>          Issue Type: Bug
>            Reporter: Ralf Assmann
>         Assigned To: Jeff Butler
>             Fix For: 2.3.0
>
>         Attachments: Resources.java, Resources.java
>
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira