<blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">Patch Set 4:</p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">Patch Set 4:</p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">Patch Set 4:</p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">Patch Set 4:</p><p style="white-space: pre-wrap; word-wrap: break-word;">I don't think the predefined multiplier is a good idea.<br>The ODBC Driver Manager should resolve this issue.<br>There are 2 encodings: server (driver) and client (application).<br>If the server encoding is UTF16 and client is UTF8 then Driver Manager should convert UTF16 to UTF8 and vice versa. Look at SQL_ATTR_APP_UNICODE_TYPE and SQL_ATTR_DRIVER_UNICODE_TYPE</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">Okay, it's theoretically possible to get server and client encodings. But how you offer to convert a buffer length for UTF16 (commonly used server encoding for Windows) to a buffer length for UTF8 (commonly used Asterisk, CLI, SIP-Phones encoding)? AFAIK, there're no algos for it in theory.</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">I just did a test with MySQL.</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">CREATE TABLE test_utf8 (<br>    test_fld varchar(200)<br>) DEFAULT CHARACTER SET utf8<br>  DEFAULT COLLATE utf8_general_ci;</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">CREATE TABLE test_utf16 (<br>    test_fld varchar(200)<br>) DEFAULT CHARACTER SET utf16<br>  DEFAULT COLLATE utf16_general_ci;</pre><p style="white-space: pre-wrap; word-wrap: break-word;">The SQLDescribeCol returns collen=200 for both tables.<br>SQLColAttribute with SQL_DESC_OCTET_LENGTH returns<br>test_utf8  - 600<br>test_utf16 - 800</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">It's OK for MySQL (that can store the data in various encodings). But MS SQL (prior 2019) can store Unicode data (NCHAR/NVARCHAR/NTEXT types) in UTF-16 only.</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">My point is that the ODBC driver should correctly return SQL_DESC_OCTET_LENGTH.<br>If it's not that the issue either with driver configuration or driver implementation.<br></p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/12812">View Change</a></p><ul style="list-style: none; padding: 0;"></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/12812">change 12812</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/12812"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I50e86c8a277996f13d4a4b9b318ece0d60b279bf </div>
<div style="display:none"> Gerrit-Change-Number: 12812 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: Boris P. Korzun <drtr0jan@yandex.ru> </div>
<div style="display:none"> Gerrit-Reviewer: Alexei Gradinari <alex2grad@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Boris P. Korzun <drtr0jan@yandex.ru> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-CC: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 04 Sep 2019 13:42:36 +0000 </div>
<div style="display:none"> Gerrit-HasComments: No </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Gerrit-MessageType: comment </div>