[Asterisk-code-review] func_odbc: acf_odbc_read() and cli_odbc_read() unicode support (...asterisk[master])

Alexei Gradinari asteriskteam at digium.com
Thu Aug 29 14:44:18 CDT 2019


Alexei Gradinari has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/12812 )

Change subject: func_odbc:  acf_odbc_read() and cli_odbc_read() unicode support
......................................................................


Patch Set 3:

> Patch Set 3:
> 
> > Patch Set 3: Code-Review-1
> > 
> > (1 comment)
> 
> It's incorrect. SQLColAttribute() with SQL_DESC_DISPLAY_SIZE returns maximum or actual CHARACTER length of a character string instead required byte size. And DISPLAY SIZE for any character types is "the defined (for fixed types) or maximum (for variable types) number of characters needed to display the data in character form".
> Ex, I use NVARCHAR(30) field, which content text like as 'Подменный сист админ' (20 characters, but 41 bytes). In the case SQLColAttribute() with SQL_DESC_DISPLAY_SIZE returns displaysize as 30 bytes (instead 42 by my patch).

UTF-8 is defined to encode code points in one to four bytes. In you case, the Cyrillic characters need 2 bytes to encode, but Chinese, Japanese and Korean characters need 3 bytes.


-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/12812
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I50e86c8a277996f13d4a4b9b318ece0d60b279bf
Gerrit-Change-Number: 12812
Gerrit-PatchSet: 3
Gerrit-Owner: Boris P. Korzun <drtr0jan at yandex.ru>
Gerrit-Reviewer: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Boris P. Korzun <drtr0jan at yandex.ru>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Comment-Date: Thu, 29 Aug 2019 19:44:18 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190829/553ac655/attachment.html>


More information about the asterisk-code-review mailing list