Re: Cannot send UTF-8 chars to MSSQL 2008

Niklas Lampén <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
> >>> 1> UPDATE Mod_Texts SET ContentData='foo Найти' WHERE
> ContentId=6824;
> >> Is that field even capable of storing Cyrillic letters?
> > Yes, it is. The field is NVARCHAR and if I use Microsoft SQL Server
> Management Studio, I can insert that string in it and fetch it correctly
> with FreeTDS.
> 
> Try inserting it like this instead:
> 
> ContentData=N'foo Найти'
> 
> Note the extra N before the quotes.

That works, thanks! Now that you pointed that out, it's obvious it should be that way. It's easy to be smart afterwards...

Calling stored procedure with tsql

1> EXECUTE Mod_Text_Put_Content @ContentId=6824, @Content=N'Найти', @SiteId='niklas'
2> go

is a success, too. Now I just have to figure out how to submit that data from PHP with this Unicode marking N. I can choose field types for mssql_bind() from SQLTEXT, SQLVARCHAR, SQLCHAR, SQLINT1, SQLINT2, SQLINT4, SQLBIT, SQLFLT4, SQLFLT8, and SQLFLTN. As one can see, there is no SQLNVARCHAR or equivalent.


Niklas

_______________________________________________
FreeTDS mailing list
[email protected]
http://lists.ibiblio.org/mailman/listinfo/freetds
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.