Req #60818 [Opn->Csd]: cannot quote strings as NVARCHAR
| From: | adambaratz@php.net | Date: | Mon, 10 Apr 2017 20:48:02 +0000 |
| Subject: | Req #60818 [Opn->Csd]: cannot quote strings as NVARCHAR | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-208459@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=60818&edit=1
ID: 60818
Updated by: adambaratz@php.net
Reported by: wrobel at wsb-nlu dot edu dot pl
Summary: cannot quote strings as NVARCHAR
-Status: Open
+Status: Closed
Type: Feature/Change Request
Package: PDO DBlib
PHP Version: Irrelevant
-Assigned To:
+Assigned To: adambaratz
Block user comment: N
Private report: N
New Comment:
Closing, as the RFC was accepted. This functionality will be available in PHP 7.2:
https://github.com/php/php-src/commit/4afce8ec8c6660ebd9f9eb174d2614361d1c6129
Previous Comments:
------------------------------------------------------------------------
[2017-03-15 15:41:04] adambaratz@php.net
I posted an RFC to address this issue:
https://wiki.php.net/rfc/extended-string-types-for-pdo
It's currently being voted on.
------------------------------------------------------------------------
[2016-09-12 21:19:24] adambaratz@php.net
This is a limitation of how PDO handles types.
I implemented a hackish solution here:
https://github.com/wayfair/php-src/commit/0190df6da7a4c39b235a75161fdc880acde5c28f
It's not clean enough for general use, but could work in a pinch if you're willing to do a
custom build.
I sketched out a better solution here:
https://github.com/php/php-src/pull/2017#discussion_r72349801
------------------------------------------------------------------------
[2012-04-02 03:28:56] ssufficool@php.net
This will require a re-write of the PDO_DBLIB to allow the use of the "encoding"
option. After that, all queries and parameter will require you to encode them
before binding with utf8_encode(). You will also have to decode them using
utf8_decode() when returned from the server. I was working to bring full Unicode
support to the driver, but it would have broken so much code I had to rethink the
strategy.
------------------------------------------------------------------------
[2012-01-24 11:32:39] redman dot naw at gmail dot com
Hi,
-you should use utf8_decode to convert UTF8 character to ISO-8859-1(latin-1) character
- i use this function with MySQL, that's work :D
------------------------------------------------------------------------
[2012-01-20 12:04:20] wrobel at wsb-nlu dot edu dot pl
Description:
------------
I have a problem storing UTF data on MSSQL using pdo_dblib.
In the following query:
EXECUTE p_proc id = :id, @name = :name
I cannot bind the ":name" param using the N'string' notation required by SQL
Server (see http://support.microsoft.com/kb/239530)
You cannot get around this by typing:
EXECUTE p_proc id = :id, @name = N:name
because binding fails on N:name
The same problem happens with qoute function - it allways quotes with '' a never with
N'' - perhaps there should be a new param like PDO::PARAM_STR to tell that with deal with
a Unicode value?
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60818&edit=1