|
it
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Eatern-european characters
Hi,
I am using an ACCESS-database to store Slovak words. Those words may contain special characters like : Č Ď Ě Ľ Ň Ř ŠŤ Ž. When I want to retreave and show those words in IE using ASP, those characters are replaced by a questionmark! I suppose I need to use codepages, and I have done quit som research on the internet but I can not get it to work properly... Who can help me with this ??? Thanks, Janošik. "Janosik" <j**@vlaamsemolshoop.be> wrote in message Make sure you save your ASP pages are saved using UTF-8 encoding.news:1193187510.633984.310640@e9g2000prf.googlegroups.com... >Hi, > >I am using an ACCESS-database to store Slovak words. Those words may >contain special characters like : C D E L N R S T Z. >When I want to retreave and show those words in IE using ASP, those >characters are replaced by a questionmark! I suppose I need to use >codepages, and I have done quit som research on the internet but I can >not get it to work properly... >Who can help me with this ??? Add in the top your pages:- <%@codepage=65001 %> Also add in the code of your page:- Response.CharSet = "UTF-8" Are using HTML forms where the user may enter such characters that are then posted to an ASP page to be saved in the DB? If so and your receiving pages were not set to the correct codepage you may have some corrupt data in your DB. -- Anthony Jones - MVP ASP/ASP.NET Hi again,
I found some PHP-code that works fine, but I can't get it to work in ASP : $mysql_id=mysql_connect("$dbhost","$dbuser","$dbpass"); mysql_query("SET CHARACTER SET 'utf8'", $mysql_id); What's the ASP-version for this last line? It should explicitly define encoding in which data are transferred from the database. Thanks and best regards, Janošik. "Janosik" <j**@vlaamsemolshoop.be> wrote in message There isn't one. ASP doesn't provide the same seamless DB access functionsnews:1194354793.475142.61470@19g2000hsx.googlegroups.com... >Hi again, > >I found some PHP-code that works fine, but I can't get it to work in >ASP : > > $mysql_id=mysql_connect("$dbhost","$dbuser","$dbpass"); > mysql_query("SET CHARACTER SET 'utf8'", $mysql_id); > >What's the ASP-version for this last line? that PHP does for MySQL. I would guess you would need an ADODB connection using an ODBC provider and the MySQL ODBC connector. You may then be able to execute this command using the connection execute method. However whether that is useful or not I can't say. >It should explicitly define encoding in which data are transferred Yes it should see the client (thats the Web server in thisc case) as a>from the database. Unicode user. All strings in ADO and VBScript/JScript are unicode. IIRC correctly there is a configuration setting somewhere in MySQL which specifies what assumption it can make about the codepage the client is using. I could be wrong MySQL isn't common in ASP development. Once the string is retreived correctly from the DB Server as unicode string it can be written to the browser using the techiniques I've already posted. BTW, why not just stick with PHP? -- Anthony Jones - MVP ASP/ASP.NET On 6 nov, 14:59, "Anthony Jones" <A***@yadayadayada.com> wrote: I used this command :>...  You may then be able to execute this command using the connection execute method. objConn.Execute "SET CHARACTER SET UTF8" and it finally works :-) ! However... it seems to me there still is something strange going on... I used the command ONCE ine ONE ASP-test... and it worked! Suddenly, all the other ASP-tests also work, even without inserting the command. The PHP-tests however only work WITH the command... > BTW,  why not just stick with PHP? well... I think I don't know enough about PHP to succesfuly complete> > -- > Anthony Jones - MVP ASP/ASP.NET this project :-/ I know... it should exactly be a reason to stick with PHP, but ..... anyway, thanks a lot for the super-tips you gave me! Best regards, Janošik. |
|||||||||||||||||||||||