Bug #80869 [Fbk->Opn]: SQL Server: Read NVARCHAR Unicode
| From: | cmb@php.net | Date: | Mon, 15 Mar 2021 20:53:37 +0000 |
| Subject: | Bug #80869 [Fbk->Opn]: SQL Server: Read NVARCHAR Unicode | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-232756@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80869&edit=1
ID: 80869
Updated by: cmb@php.net
Reported by: sergiopaternoster73 at gmail dot com
Summary: SQL Server: Read NVARCHAR Unicode
-Status: Feedback
+Status: Open
Type: Bug
Package: PDO ODBC
Operating System: Ubuntu 18.04 Server
PHP Version: 8.0.3
-Assigned To: cmb
+Assigned To:
Block user comment: N
Private report: N
New Comment:
Thank you for the traces! These are actually quite helpful,
because the first lines show a difference in the setup or build
(7.4 uses ISO-8859-1, while 8.0 uses UTF-8). I don't know
FreeTDS, so I have no idea why they are using different client
charsets. Consider to ask on a FreeTDS support channel, too.
Previous Comments:
------------------------------------------------------------------------
[2021-03-15 18:08:58] sergiopaternoster73 at gmail dot com
Thank you for the guidance. Here the traces:
php-7.4
https://gist.github.com/capsandiego/8f2176ebc29ab961612bb225f06f452e
php-8.0.3
https://gist.github.com/capsandiego/92d963c3fa40bfcf8861bc46a2d33f35
------------------------------------------------------------------------
[2021-03-15 17:47:55] cmb@php.net
An ODBC trace is not related to segfaults (you probably mean a
stack backtrace). Anyway, since I'm using Windows I'm not sure
how to get an ODBC trace on your platform, but the FreeTDS User
Guide has a chapter on logging[1]; probably the last section on
this page is relevant.
See <https://bugs.php.net/80868#1615816567> for an
example of an
ODBC trace.
<https://www.freetds.org/userguide/logging.html>
------------------------------------------------------------------------
[2021-03-15 17:42:41] sergiopaternoster73 at gmail dot com
I tested it with a newer SQL Server 2017 and a "cleaner" NVARCHAR table. Here the results
with PHP 7 and 8. Looks like the encoding is ASCII in PHP 8 while it's UTF-8 in PHP 7
Version: 7.4.13
mb_detect_encoding(): UTF-8
Result:
æ²³å馿²³ç»æµå¼ååºè¿æ²³å¤§éä¸ä¾§å®æè¡åä¾§
Version: 8.0.3
mb_detect_encoding(): ASCII
Result: ????????????????????
------------------------------------------------------------------------
[2021-03-15 17:19:06] sergiopaternoster73 at gmail dot com
Please, pardon my ignorance. I don't get any segfault. How can I provide an ODBC trace?
------------------------------------------------------------------------
[2021-03-15 16:49:15] cmb@php.net
Could you please provide ODBC traces for PHP 7.4 and 8.0; ideally
place them somewhere publicly accessible on the Web (e.g.
gist.github.com, pastebin.com) and only link to them.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=80869
--
Edit this bug report at https://bugs.php.net/bug.php?id=80869&edit=1