My favorites | Sign in
Project Home Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 16: Can not handle Chinese characters in Jira comment
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  AlexHars...@gmail.com
Closed:  Jan 2013


Sign in to add a comment
 
Reported by baohao...@gmail.com, Jan 28, 2013
Patch is attached. Without the patch, there will be errors like this:

    signal(soap-error ("soapenv:Server.userException" "org.xml.sax.SAXParseException: XML document structures must start and end within the same entity."))

The error is caused because the Chinese characters are not encoded correctly: 

    url-request-data is a variable defined in `url-vars.el'.
    Its value is
    "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<soap:Envelope\n    soapenc:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"\n    xmlns:tns1=\"http://beans.soap.rpc.jira.atlassian.com\"\n    xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n    xmlns:ns1=\"urn:JiraSoapService\"\n    xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n    xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"\n    xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"\n>\n<soap:Body>\n<ns1:editComment>\n<in0 xsi:type=\"xsd:string\">trustedappstoken</in0>\n<in1 xsi:type=\"tns1:RemoteComment\">\n<body xsi:type=\"xsd:string\">从黄波那儿接手过来这个ticket之后,有一些新的方向。他之前是把kernel的\npreempt机制给关掉了,但这个风险实在是太大了,主要是performance很受影响,\n用安兔兔跑高分的会大受打击。\n\n我的看法是需要打开kernel的一些debug宏来进行调试,跟lock有关的。目前发现很多类似这样的log:\n\nBUG: sleeping function called from invalid context at kernel/mutex.c:269\n\n这个可能需要跟APSE去沟通一下,看看他们有没有什么建议。</body>\n<id xsi:type=\"xsd:string\">63611</id>\n</in1>\n</ns1:editComment>\n</soap:Body>\n</soap:Envelope>\n"

After the patch, they are encoded:


    url-request-data is a variable defined in `url-vars.el'.
    Its value is
    "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<soap:Envelope\n    soapenc:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"\n    xmlns:tns1=\"http://beans.soap.rpc.jira.atlassian.com\"\n    xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n    xmlns:ns1=\"urn:JiraSoapService\"\n    xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n    xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"\n    xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"\n>\n<soap:Body>\n<ns1:editComment>\n<in0 xsi:type=\"xsd:string\">trustedappstoken</in0>\n<in1 xsi:type=\"tns1:RemoteComment\">\n<body xsi:type=\"xsd:string\">\344\273\216\351\273\204\346\263\242\351\202\243\345\204\277\346\216\245\346\211\213\350\277\207\346\235\245\350\277\231\344\270\252ticket\344\271\213\345\220\216\357\274\214\346\234\211\344\270\200\344\272\233\346\226\260\347\232\204\346\226\271\345\220\221\343\200\202\344\273\226\344\271\213\345\211\215\346\230\257\346\212\212kernel\347\232\204\npreempt\346\234\272\345\210\266\347\273\231\345\205\263\346\216\211\344\272\206\357\274\214\344\275\206\350\277\231\344\270\252\351\243\216\351\231\251\345\256\236\345\234\250\346\230\257\345\244\252\345\244\247\344\272\206\357\274\214\344\270\273\350\246\201\346\230\257performance\345\276\210\345\217\227\345\275\261\345\223\215\357\274\214\n\347\224\250\345\256\211\345\205\224\345\205\224\350\267\221\351\253\230\345\210\206\347\232\204\344\274\232\345\244\247\345\217\227\346\211\223\345\207\273\343\200\202\n\n\346\210\221\347\232\204\347\234\213\346\263\225\346\230\257\351\234\200\350\246\201\346\211\223\345\274\200kernel\347\232\204\344\270\200\344\272\233debug\345\256\217\346\235\245\350\277\233\350\241\214\350\260\203\350\257\225\357\274\214\350\267\237lock\346\234\211\345\205\263\347\232\204\343\200\202\347\233\256\345\211\215\345\217\221\347\216\260\345\276\210\345\244\232\347\261\273\344\274\274\350\277\231\346\240\267\347\232\204log\357\274\232\n\nBUG: sleeping function called from invalid context at kernel/mutex.c:269\n\n\350\277\231\344\270\252\345\217\257\350\203\275\351\234\200\350\246\201\350\267\237APSE\345\216\273\346\262\237\351\200\232\344\270\200\344\270\213\357\274\214\347\234\213\347\234\213\344\273\226\344\273\254\346\234\211\346\262\241\346\234\211\344\273\200\344\271\210\345\273\272\350\256\256\343\200\202</body>\n<id xsi:type=\"xsd:string\">63611</id>\n</in1>\n</ns1:editComment>\n</soap:Body>\n</soap:Envelope>\n"
    
    
0001-Patch-for-soap-client.patch
688 bytes   View   Download
Jan 28, 2013
#1 baohao...@gmail.com
The patch is applicable to the hg revision 68 (the current master branch).
Jan 29, 2013
Project Member #2 AlexHars...@gmail.com
This issue was closed by revision a4b857222c5a.
Status: Fixed
Jan 29, 2013
Project Member #3 AlexHars...@gmail.com
Thanks for reporting this issue.

I attempted a different fix than it was suggested by the patch, as I wanted `soap-create-envelope' to return an Emacs multi-byte string (since that function is used in some of my testing).

Can you please check if my fix works for you?  If it does, I will ask the Emacs maintainers to include it in the soap-client version that is bundled with Emacs.

Thanks,
Alex.
Owner: AlexHars...@gmail.com
Jan 29, 2013
#4 baohao...@gmail.com
Hi, Alex

I have tested your fix, it is working fine.

In fact I reported this issue a year ago, in the last reply to your QuickStart wiki. I have used your soap-client.el to implement the org-jira package: http://baohaojun.github.com/org-jira.html

Thank you!
Feb 2, 2013
Project Member #5 AlexHars...@gmail.com
This fix has been committed into the GNU Emacs repository.  It will be avaliable in Emacs 24.4 (but not 24.3 unfortunately).
Sign in to add a comment

Powered by Google Project Hosting