107 if ((wc_len = MultiByteToWideChar(codepage,
flags,
ZSTR_VAL(
string), (
int)mb_len + 1,
NULL, 0)) <= 0) {
110 if ((bstr = SysAllocStringLen(
NULL, (UINT)(wc_len - 1))) ==
NULL) {
113 if ((wc_len = MultiByteToWideChar(codepage,
flags,
ZSTR_VAL(
string), (
int)mb_len + 1, bstr, wc_len)) <= 0) {
121 "Could not convert string to unicode: `%s'",
msg);
124 return SysAllocString(L
"");
130 UINT wc_len = SysStringLen(bstr);
133 mb_len = WideCharToMultiByte(codepage, 0, bstr, wc_len + 1,
NULL, 0,
NULL,
NULL);
135 string = zend_string_alloc(mb_len - 1, 0);
136 mb_len = WideCharToMultiByte(codepage, 0, bstr, wc_len + 1,
ZSTR_VAL(
string), mb_len,
NULL,
NULL);
143 "Could not convert string from unicode: `%s'",
msg);
146 if (
string !=
NULL) {
147 zend_string_release(
string);
PHPAPI ZEND_COLD void php_error_docref(const char *docref, int type, const char *format,...)