Skip to Content.
Sympa Menu

freetds - [freetds] Re: Problem of unicode ( Inserted data / Query )

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Daniel Fazekas <fdsubs AT axelero.hu>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Re: Problem of unicode ( Inserted data / Query )
  • Date: Mon, 29 Mar 2004 18:57:15 +0200


On Mar 29, 2004, at 18:17, edwardspl AT ita.org.mo wrote:

Dear You,
How to control php convert inserted data or query to / from MS-SQL ( MUST in
charset of unicode ) ?

Please, Edward, for Christ's sake, just tell us already what your *problem* is and what are you trying to do.

There are dozens of places and ways to do a character encoding translation.

If it is a web application, which we can't know for sure as you are really secretive about what you are trying to accomplish, then you could simply serve the html page with the character encoding you desire.

You can do that by adding a
<meta http-equiv="content-type" content="text/html; charset=utf-8">

inside the <head> ... </head> part of your page. Or, you could do the same with PHP, *before outputting any data*, by modifying the http response headers like this:

<?php
header('Content-type: text/html; charset=utf-8');
?>

If you did this, the character encoding conversion's task is up to the client's browser. You receive the client's reply in the same character encoding you used for your page.

If, for some reason you still have to convert it afterwards, you can use the iconv extension in php:

http://www.php.net/iconv


And finally, you can get FreeTDS to do the conversion for you, by setting the character encoding in the freetds.conf file, as James described to you several times over, on every second day the past couple of months.


A client user ( using his/her own language ) insert some data into MS-SQL,
then MS-SQL MUST store the data ( which come from the client user ) in unicode
format ( charset ).

Where and how is that client inserting the data into the database?
A web application?

What's your problem? What isn't working the way you'd like it to?

A client user ( using his/her own language ) search some info from MS-SQL, but
all of the format of stored data were unicode ( charset ), so must convert the
charset of unicode to a special format ( charset ) for the client user (
correspond to his/her own language )

No, you don't have to convert anything usually. Any web browser on any operating system released in the past couple days can display unicode web pages just fine.

--
fds





Archive powered by MHonArc 2.6.24.

Top of Page