{"action":"created","issue":{"url":"https://api.github.com/repos/processone/ejabberd/issues/2404","repository_url":"https://api.github.com/repos/processone/ejabberd","labels_url":"https://api.github.com/repos/processone/ejabberd/issues/2404/labels{/name}","comments_url":"https://api.github.com/repos/processone/ejabberd/issues/2404/comments","events_url":"https://api.github.com/repos/processone/ejabberd/issues/2404/events","html_url":"https://github.com/processone/ejabberd/issues/2404","id":319896597,"node_id":"MDU6SXNzdWUzMTk4OTY1OTc=","number":2404,"title":"UTF-8 Characters in MSSQL gets corrupted. ","user":{"login":"UgniusD","id":38076982,"node_id":"MDQ6VXNlcjM4MDc2OTgy","avatar_url":"https://avatars1.githubusercontent.com/u/38076982?v=4","gravatar_id":"","url":"https://api.github.com/users/UgniusD","html_url":"https://github.com/UgniusD","followers_url":"https://api.github.com/users/UgniusD/followers","following_url":"https://api.github.com/users/UgniusD/following{/other_user}","gists_url":"https://api.github.com/users/UgniusD/gists{/gist_id}","starred_url":"https://api.github.com/users/UgniusD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UgniusD/subscriptions","organizations_url":"https://api.github.com/users/UgniusD/orgs","repos_url":"https://api.github.com/users/UgniusD/repos","events_url":"https://api.github.com/users/UgniusD/events{/privacy}","received_events_url":"https://api.github.com/users/UgniusD/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-03T12:18:36Z","updated_at":"2018-09-07T15:33:01Z","closed_at":null,"author_association":"NONE","body":"> What version of ejabberd are you using?\r\n\r\n18.01\r\n\r\n> What operating system (version) are you using?\r\n\r\nRhel 7\r\n\r\n> How did you install ejabberd (source, package, distribution)?\r\n\r\nFrom source also tried rpm and got same result.\r\n\r\n> What did not work as expected? Are there error messages in the log? What\r\n> was the unexpected behavior? What was the expected result?\r\n\r\nWhen using MSSQL all messages that contain utf-8 characters gets corrupted in database.\r\nFor example ąčę becomes: \"Ä?ÄÄ?\" I think I'm missing something with MSSQL (2016) setup and I'm out of ideas what I could change. Maybe collation?\r\nIf i try to insert via isql or tsql everything works fine. Even posting from ejabberd via custom mod works.\r\n\r\nLooks like issue is somewhere here:\r\n(ejabberd@Server.com)3> X = unicode:characters_to_binary(\"ąčęėįšųū90- test\").\r\nio:format(\"~s\",[X]). \r\nÄ�Ä�Ä�Ä�Ä¯Å¡Å³Å«90- testok\r\nio:format(\"~ts\",[X]).\r\nąčęėįšųū90- testok\r\nThis was client encoding issue.\r\nBut after this we found out that sql insert/update in all modules of Ejabberd is wrong. MsSQL needs different syntax for inserts and updates if you are using utf characters. N before quotes that specifies that this will be utf. if its not there utf characters gets striped. \r\n\r\nAny help would be greatly appreciated. \r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/processone/ejabberd/issues/comments/419477686","html_url":"https://github.com/processone/ejabberd/issues/2404#issuecomment-419477686","issue_url":"https://api.github.com/repos/processone/ejabberd/issues/2404","id":419477686,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTQ3NzY4Ng==","user":{"login":"zinid","id":1095902,"node_id":"MDQ6VXNlcjEwOTU5MDI=","avatar_url":"https://avatars3.githubusercontent.com/u/1095902?v=4","gravatar_id":"","url":"https://api.github.com/users/zinid","html_url":"https://github.com/zinid","followers_url":"https://api.github.com/users/zinid/followers","following_url":"https://api.github.com/users/zinid/following{/other_user}","gists_url":"https://api.github.com/users/zinid/gists{/gist_id}","starred_url":"https://api.github.com/users/zinid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zinid/subscriptions","organizations_url":"https://api.github.com/users/zinid/orgs","repos_url":"https://api.github.com/users/zinid/repos","events_url":"https://api.github.com/users/zinid/events{/privacy}","received_events_url":"https://api.github.com/users/zinid/received_events","type":"User","site_admin":false},"created_at":"2018-09-07T15:33:01Z","updated_at":"2018-09-07T15:33:01Z","author_association":"MEMBER","body":"> This works for UTF-8 only. Some more coding needed to parametrize charset\r\n\r\nNo need since ejabberd only speaks UTF-8 because XMPP doesn't allow other charsets.\r\nPlease create a PR if you want your patch to be merged ASAP."}}
{"actor":{"display_login":"zinid"}}