You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by "Andreas Veithen (JIRA)" <ji...@apache.org> on 2008/03/24 23:27:24 UTC

[jira] Created: (SYNAPSE-261) VFS transport doesn't handle text file encoding

VFS transport doesn't handle text file encoding
-----------------------------------------------

                 Key: SYNAPSE-261
                 URL: https://issues.apache.org/jira/browse/SYNAPSE-261
             Project: Synapse
          Issue Type: Bug
    Affects Versions: 1.1
            Reporter: Andreas Veithen
             Fix For: 1.2


* VFSUtils#getMessageTextPayload reads the file into a byte[] and constructs a String object from it without specifying the encoding.
* VFSTransportSender#populateResponseFile uses String#getBytes without specifying the encoding.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] Commented: (SYNAPSE-261) VFS transport doesn't handle text file encoding

Posted by "Ruwan Linton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SYNAPSE-261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12591607#action_12591607 ] 

Ruwan Linton commented on SYNAPSE-261:
--------------------------------------

Andreas, will you be able to look in to this, or have you started work on this issue? If not I will take this over.

Ruwan

> VFS transport doesn't handle text file encoding
> -----------------------------------------------
>
>                 Key: SYNAPSE-261
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-261
>             Project: Synapse
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: 1.2
>
>
> * VFSUtils#getMessageTextPayload reads the file into a byte[] and constructs a String object from it without specifying the encoding.
> * VFSTransportSender#populateResponseFile uses String#getBytes without specifying the encoding.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] Commented: (SYNAPSE-261) VFS transport doesn't handle text file encoding

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SYNAPSE-261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595505#action_12595505 ] 

Andreas Veithen commented on SYNAPSE-261:
-----------------------------------------

The problem is fixed for outgoing messages, but not yet for incoming text files picked up by the VFS transport. I will try to have a look at this during the weekend, but probably we will have to move this to the next release.

> VFS transport doesn't handle text file encoding
> -----------------------------------------------
>
>                 Key: SYNAPSE-261
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-261
>             Project: Synapse
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: 1.2
>
>
> * VFSUtils#getMessageTextPayload reads the file into a byte[] and constructs a String object from it without specifying the encoding.
> * VFSTransportSender#populateResponseFile uses String#getBytes without specifying the encoding.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] Commented: (SYNAPSE-261) VFS transport doesn't handle text file encoding

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SYNAPSE-261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592190#action_12592190 ] 

Andreas Veithen commented on SYNAPSE-261:
-----------------------------------------

First of all, an additional comment: I think the problem is not limited to the VFS transport and that we have a similar problem in MailTransportSender#sendMail and in the PlainTextFormatter class added by Asankha some time ago.

I was asking myself whether it would not be better to remove the code that handles plain text (and also binary data) from the VFS and mail transports and use MessageFormatters to handle these cases (with correct character encoding handling once and for all). I didn't have the time yet to analyze this further. What is your opinion?

> VFS transport doesn't handle text file encoding
> -----------------------------------------------
>
>                 Key: SYNAPSE-261
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-261
>             Project: Synapse
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: 1.2
>
>
> * VFSUtils#getMessageTextPayload reads the file into a byte[] and constructs a String object from it without specifying the encoding.
> * VFSTransportSender#populateResponseFile uses String#getBytes without specifying the encoding.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] Commented: (SYNAPSE-261) VFS transport doesn't handle text file encoding

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SYNAPSE-261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12593957#action_12593957 ] 

Andreas Veithen commented on SYNAPSE-261:
-----------------------------------------

Solved the issue for outgoing messages sent through the VFS and mail transport:
1) VFSTransportSender and MailTransportSender now always use the encoding as determined by BaseUtils.getOMOutputFormat. Since this method uses HTTPTransportUtils.getCharSetEncoding, it either takes the CHARACTER_SET_ENCODING property from the message context or uses a default encoding.
2) The <address> element in endpoint definitions can now have an "encoding" attribute. This value is stored in a new property of EndpointDefinition, which is used by Axis2FlexibleMEPClient to set the CHARACTER_SET_ENCODING property in the message context of the outgoing message.

These changes allow the user to specify the encoding by endpoint:

<send>
  <endpoint>
    <address uri="vfs:file:///Users/veithen/workspace/synapse-vfs-test/data/out" encoding="UTF-16"/>
  </endpoint>
</send>

Still to be done:
* Solve encoding issue for files picked up by VFSTransportListener.
* Correct PlainTextFormatter.
* Update documentation/samples.
* Try to isolate the binary/text payload handling code (into a MessageFormatter?) and reuse it in the different transports.

> VFS transport doesn't handle text file encoding
> -----------------------------------------------
>
>                 Key: SYNAPSE-261
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-261
>             Project: Synapse
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: 1.2
>
>
> * VFSUtils#getMessageTextPayload reads the file into a byte[] and constructs a String object from it without specifying the encoding.
> * VFSTransportSender#populateResponseFile uses String#getBytes without specifying the encoding.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] Resolved: (SYNAPSE-261) VFS transport doesn't handle text file encoding

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-261?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen resolved SYNAPSE-261.
-------------------------------------

    Resolution: Fixed

> VFS transport doesn't handle text file encoding
> -----------------------------------------------
>
>                 Key: SYNAPSE-261
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-261
>             Project: Synapse
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: 1.2
>
>
> * VFSUtils#getMessageTextPayload reads the file into a byte[] and constructs a String object from it without specifying the encoding.
> * VFSTransportSender#populateResponseFile uses String#getBytes without specifying the encoding.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] Updated: (SYNAPSE-261) VFS transport doesn't handle text file encoding

Posted by "Asankha C. Perera (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-261?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Asankha C. Perera updated SYNAPSE-261:
--------------------------------------

    Assignee: Andreas Veithen

Andreas, can you help out with this one?

> VFS transport doesn't handle text file encoding
> -----------------------------------------------
>
>                 Key: SYNAPSE-261
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-261
>             Project: Synapse
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: 1.2
>
>
> * VFSUtils#getMessageTextPayload reads the file into a byte[] and constructs a String object from it without specifying the encoding.
> * VFSTransportSender#populateResponseFile uses String#getBytes without specifying the encoding.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] Commented: (SYNAPSE-261) VFS transport doesn't handle text file encoding

Posted by "Ruwan Linton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SYNAPSE-261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595313#action_12595313 ] 

Ruwan Linton commented on SYNAPSE-261:
--------------------------------------

Andreas, will it be possible for you to finish up this for the 1.2 release? For the moment it is marked for the 1.2 release. 

If this takes time and if you think fixing this may have any affect on the stability, we can move this as post 1.2, What do you think?

> VFS transport doesn't handle text file encoding
> -----------------------------------------------
>
>                 Key: SYNAPSE-261
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-261
>             Project: Synapse
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: 1.2
>
>
> * VFSUtils#getMessageTextPayload reads the file into a byte[] and constructs a String object from it without specifying the encoding.
> * VFSTransportSender#populateResponseFile uses String#getBytes without specifying the encoding.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] Commented: (SYNAPSE-261) VFS transport doesn't handle text file encoding

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SYNAPSE-261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595907#action_12595907 ] 

Andreas Veithen commented on SYNAPSE-261:
-----------------------------------------

* The VFS and mail transports now rely on message formatters (selected by BaseUtils.getMessageFormatter) for all outgoing messages. PlainTextFormatter has been corrected to respect charset encodings. See commit comments for more details.
* The encoding issue for files picked up by VFSTransportListener has been solved using the strategy outlined in SYNAPSE-304.

The issue is now solved completely, but still need to check documentation and samples.



> VFS transport doesn't handle text file encoding
> -----------------------------------------------
>
>                 Key: SYNAPSE-261
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-261
>             Project: Synapse
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: 1.2
>
>
> * VFSUtils#getMessageTextPayload reads the file into a byte[] and constructs a String object from it without specifying the encoding.
> * VFSTransportSender#populateResponseFile uses String#getBytes without specifying the encoding.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] Commented: (SYNAPSE-261) VFS transport doesn't handle text file encoding

Posted by "Ruwan Linton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SYNAPSE-261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592290#action_12592290 ] 

Ruwan Linton commented on SYNAPSE-261:
--------------------------------------

Well, I don't have a much awareness about the issue and how to resolve it. I will have a look around and try to fix this issue.

> VFS transport doesn't handle text file encoding
> -----------------------------------------------
>
>                 Key: SYNAPSE-261
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-261
>             Project: Synapse
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: 1.2
>
>
> * VFSUtils#getMessageTextPayload reads the file into a byte[] and constructs a String object from it without specifying the encoding.
> * VFSTransportSender#populateResponseFile uses String#getBytes without specifying the encoding.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org