You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Fraser Adams (Created) (JIRA)" <ji...@apache.org> on 2011/12/17 11:38:31 UTC

[jira] [Created] (QPID-3695) In the Perl binding there doesn't appear to be a way to set the encoding of header properties to UTF8.

In the Perl binding there doesn't appear to be a way to set the encoding of header properties to UTF8.
------------------------------------------------------------------------------------------------------

                 Key: QPID-3695
                 URL: https://issues.apache.org/jira/browse/QPID-3695
             Project: Qpid
          Issue Type: Bug
          Components: Interop Testing
    Affects Versions: 0.12
         Environment: Perl
            Reporter: Fraser Adams


There have been some interoperability issues reported between Java/C++/Perl whereby there is sometimes a mismatch between C++ qpid::messaging client defaults of binary strings and expected UTF8 Strings - especially noticeable with headers exchange matching.

One of the most significant issues is with the qpid::messaging AddressParser which is resolved here:

https://issues.apache.org/jira/browse/QPID-3492

However with qpid::messaging producers one must also be careful to call setEncoding("utf8") when setting string properties.

This is OK with C++ qpid::messaging as long as one is aware of the potential issue however there's a more significant issue with the Perl binding, which is a SWIG wrapper around qpid::messaging. This "transparently" maps Perl strings into binary strings and there doesn't appear to be any way to explicitly set the encoding as the Variant type implementation is abstracted away in Perl.

The following trivial snippet allows a UTF8 property to be set on a Message:

/*
    This method properly encodes the value parameter as a UTF8 Variant type then sets the Property 
    on the Message passed in as a parameter.
*/
void setUtf8Property(Message& message, const char* key, const char* value) {
    Variant utf8Value(value);
    utf8Value.setEncoding("utf8");
    message.setProperty(key, utf8Value);
}

Obviously to be of any use in the Perl binding it would need to be added to the SWIG interface.

Perhaps there's another way to set Message properties as UTF8 from the Perl binding?





--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] [Commented] (QPID-3695) In the Perl binding there doesn't appear to be a way to set the encoding of header properties to UTF8.

Posted by "Jimmy Jones (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-3695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13499850#comment-13499850 ] 

Jimmy Jones commented on QPID-3695:
-----------------------------------

Have run the attached program on RHEL6, using version 0.18 and trunk, but I can't reproduce the issue on trunk, so I presume its fixed.
                
> In the Perl binding there doesn't appear to be a way to set the encoding of header properties to UTF8.
> ------------------------------------------------------------------------------------------------------
>
>                 Key: QPID-3695
>                 URL: https://issues.apache.org/jira/browse/QPID-3695
>             Project: Qpid
>          Issue Type: Bug
>          Components: Interop Testing
>    Affects Versions: 0.12
>         Environment: Perl
>            Reporter: Fraser Adams
>         Attachments: hello_world2.pl
>
>
> There have been some interoperability issues reported between Java/C++/Perl whereby there is sometimes a mismatch between C++ qpid::messaging client defaults of binary strings and expected UTF8 Strings - especially noticeable with headers exchange matching.
> One of the most significant issues is with the qpid::messaging AddressParser which is resolved here:
> https://issues.apache.org/jira/browse/QPID-3492
> However with qpid::messaging producers one must also be careful to call setEncoding("utf8") when setting string properties.
> This is OK with C++ qpid::messaging as long as one is aware of the potential issue however there's a more significant issue with the Perl binding, which is a SWIG wrapper around qpid::messaging. This "transparently" maps Perl strings into binary strings and there doesn't appear to be any way to explicitly set the encoding as the Variant type implementation is abstracted away in Perl.
> The following trivial snippet allows a UTF8 property to be set on a Message:
> /*
>     This method properly encodes the value parameter as a UTF8 Variant type then sets the Property 
>     on the Message passed in as a parameter.
> */
> void setUtf8Property(Message& message, const char* key, const char* value) {
>     Variant utf8Value(value);
>     utf8Value.setEncoding("utf8");
>     message.setProperty(key, utf8Value);
> }
> Obviously to be of any use in the Perl binding it would need to be added to the SWIG interface.
> Perhaps there's another way to set Message properties as UTF8 from the Perl binding?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Updated] (QPID-3695) In the Perl binding there doesn't appear to be a way to set the encoding of header properties to UTF8.

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

Jimmy Jones updated QPID-3695:
------------------------------

    Attachment: hello_world2.pl

Script to demonstrate the problem
                
> In the Perl binding there doesn't appear to be a way to set the encoding of header properties to UTF8.
> ------------------------------------------------------------------------------------------------------
>
>                 Key: QPID-3695
>                 URL: https://issues.apache.org/jira/browse/QPID-3695
>             Project: Qpid
>          Issue Type: Bug
>          Components: Interop Testing
>    Affects Versions: 0.12
>         Environment: Perl
>            Reporter: Fraser Adams
>         Attachments: hello_world2.pl
>
>
> There have been some interoperability issues reported between Java/C++/Perl whereby there is sometimes a mismatch between C++ qpid::messaging client defaults of binary strings and expected UTF8 Strings - especially noticeable with headers exchange matching.
> One of the most significant issues is with the qpid::messaging AddressParser which is resolved here:
> https://issues.apache.org/jira/browse/QPID-3492
> However with qpid::messaging producers one must also be careful to call setEncoding("utf8") when setting string properties.
> This is OK with C++ qpid::messaging as long as one is aware of the potential issue however there's a more significant issue with the Perl binding, which is a SWIG wrapper around qpid::messaging. This "transparently" maps Perl strings into binary strings and there doesn't appear to be any way to explicitly set the encoding as the Variant type implementation is abstracted away in Perl.
> The following trivial snippet allows a UTF8 property to be set on a Message:
> /*
>     This method properly encodes the value parameter as a UTF8 Variant type then sets the Property 
>     on the Message passed in as a parameter.
> */
> void setUtf8Property(Message& message, const char* key, const char* value) {
>     Variant utf8Value(value);
>     utf8Value.setEncoding("utf8");
>     message.setProperty(key, utf8Value);
> }
> Obviously to be of any use in the Perl binding it would need to be added to the SWIG interface.
> Perhaps there's another way to set Message properties as UTF8 from the Perl binding?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Commented] (QPID-3695) In the Perl binding there doesn't appear to be a way to set the encoding of header properties to UTF8.

Posted by "Jimmy Jones (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-3695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13490086#comment-13490086 ] 

Jimmy Jones commented on QPID-3695:
-----------------------------------

I'm also having the same problem. As far as I can see, I can't match messages sent to a headers exchange from perl, unless I hack the bindings.
                
> In the Perl binding there doesn't appear to be a way to set the encoding of header properties to UTF8.
> ------------------------------------------------------------------------------------------------------
>
>                 Key: QPID-3695
>                 URL: https://issues.apache.org/jira/browse/QPID-3695
>             Project: Qpid
>          Issue Type: Bug
>          Components: Interop Testing
>    Affects Versions: 0.12
>         Environment: Perl
>            Reporter: Fraser Adams
>
> There have been some interoperability issues reported between Java/C++/Perl whereby there is sometimes a mismatch between C++ qpid::messaging client defaults of binary strings and expected UTF8 Strings - especially noticeable with headers exchange matching.
> One of the most significant issues is with the qpid::messaging AddressParser which is resolved here:
> https://issues.apache.org/jira/browse/QPID-3492
> However with qpid::messaging producers one must also be careful to call setEncoding("utf8") when setting string properties.
> This is OK with C++ qpid::messaging as long as one is aware of the potential issue however there's a more significant issue with the Perl binding, which is a SWIG wrapper around qpid::messaging. This "transparently" maps Perl strings into binary strings and there doesn't appear to be any way to explicitly set the encoding as the Variant type implementation is abstracted away in Perl.
> The following trivial snippet allows a UTF8 property to be set on a Message:
> /*
>     This method properly encodes the value parameter as a UTF8 Variant type then sets the Property 
>     on the Message passed in as a parameter.
> */
> void setUtf8Property(Message& message, const char* key, const char* value) {
>     Variant utf8Value(value);
>     utf8Value.setEncoding("utf8");
>     message.setProperty(key, utf8Value);
> }
> Obviously to be of any use in the Perl binding it would need to be added to the SWIG interface.
> Perhaps there's another way to set Message properties as UTF8 from the Perl binding?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Commented] (QPID-3695) In the Perl binding there doesn't appear to be a way to set the encoding of header properties to UTF8.

Posted by "Jimmy Jones (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-3695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13502933#comment-13502933 ] 

Jimmy Jones commented on QPID-3695:
-----------------------------------

Gordon's comment on QPID-4442 confirms the headers exchange now compares the bytes regardless of encoding.
                
> In the Perl binding there doesn't appear to be a way to set the encoding of header properties to UTF8.
> ------------------------------------------------------------------------------------------------------
>
>                 Key: QPID-3695
>                 URL: https://issues.apache.org/jira/browse/QPID-3695
>             Project: Qpid
>          Issue Type: Bug
>          Components: Interop Testing
>    Affects Versions: 0.12
>         Environment: Perl
>            Reporter: Fraser Adams
>         Attachments: hello_world2.pl
>
>
> There have been some interoperability issues reported between Java/C++/Perl whereby there is sometimes a mismatch between C++ qpid::messaging client defaults of binary strings and expected UTF8 Strings - especially noticeable with headers exchange matching.
> One of the most significant issues is with the qpid::messaging AddressParser which is resolved here:
> https://issues.apache.org/jira/browse/QPID-3492
> However with qpid::messaging producers one must also be careful to call setEncoding("utf8") when setting string properties.
> This is OK with C++ qpid::messaging as long as one is aware of the potential issue however there's a more significant issue with the Perl binding, which is a SWIG wrapper around qpid::messaging. This "transparently" maps Perl strings into binary strings and there doesn't appear to be any way to explicitly set the encoding as the Variant type implementation is abstracted away in Perl.
> The following trivial snippet allows a UTF8 property to be set on a Message:
> /*
>     This method properly encodes the value parameter as a UTF8 Variant type then sets the Property 
>     on the Message passed in as a parameter.
> */
> void setUtf8Property(Message& message, const char* key, const char* value) {
>     Variant utf8Value(value);
>     utf8Value.setEncoding("utf8");
>     message.setProperty(key, utf8Value);
> }
> Obviously to be of any use in the Perl binding it would need to be added to the SWIG interface.
> Perhaps there's another way to set Message properties as UTF8 from the Perl binding?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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