<p>I tested this patch all. Now issue is fixed.<br>
Also exist other way to fix this. Need to use</p>
<pre><code>SELECT convert_from(body,'UTF-8') FROM presentity;
</code></pre>
<p>in SQL request to PostgreSQL server instreat of</p>
<pre><code>SELECT body FROM presentity;
</code></pre>
<p>Example</p>
<pre><code>pg1:~$ psql kamailio
psql (9.6.3)
Type "help" for help.
kamailio=# CREATE TABLE blob_table (blob bytea);
CREATE TABLE
kamailio=# INSERT INTO blob_table VALUES ('Kamailio');
INSERT 0 1
kamailio=# SELECT blob, convert_from(blob,'UTF-8') FROM blob_table;
blob | convert_from
--------------------+--------------
\x4b616d61696c696f | Kamailio
(1 row)
</code></pre>
<p>Second way is more elegant but i do not know hot to need change source code.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/1255#issuecomment-428489293">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZT1uU4NDg1B9SH6M3lucc03-I5vHks5ujbOUgaJpZM4PoBLO">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36ZRwCj94clcfM2DRn-HwfdxI5FxKPks5ujbOUgaJpZM4PoBLO.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@sergey-safarov in #1255: I tested this patch all. Now issue is fixed.\r\nAlso exist other way to fix this. Need to use\r\n```\r\nSELECT convert_from(body,'UTF-8') FROM presentity;\r\n```\r\nin SQL request to PostgreSQL server instreat of\r\n```\r\nSELECT body FROM presentity;\r\n```\r\n\r\nExample\r\n```\r\npg1:~$ psql kamailio\r\npsql (9.6.3)\r\nType \"help\" for help.\r\n\r\nkamailio=# CREATE TABLE blob_table (blob bytea);\r\nCREATE TABLE\r\nkamailio=# INSERT INTO blob_table VALUES ('Kamailio');\r\nINSERT 0 1\r\nkamailio=# SELECT blob, convert_from(blob,'UTF-8') FROM blob_table;\r\n blob | convert_from \r\n--------------------+--------------\r\n \\x4b616d61696c696f | Kamailio\r\n(1 row)\r\n```\r\n\r\nSecond way is more elegant but i do not know hot to need change source code."}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1255#issuecomment-428489293"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/1255#issuecomment-428489293",
"url": "https://github.com/kamailio/kamailio/issues/1255#issuecomment-428489293",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Re: [kamailio/kamailio] DB Postgres BLOB conversion for presence (#1255)",
"sections": [
{
"text": "",
"activityTitle": "**sergey-safarov**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@sergey-safarov",
"facts": [
]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 1255,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/kamailio/kamailio/issues/1255#issuecomment-428489293"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 262148814\n}"
}
],
"themeColor": "26292E"
}
]</script>