Eatern-european characters

J

Janošik

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.
 
A

Anthony Jones

Janosik said:
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 ???


Make sure you save your ASP pages are saved using UTF-8 encoding.

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.
 
J

Janošik

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.
 
A

Anthony Jones

Janosik said:
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?

There isn't one. ASP doesn't provide the same seamless DB access functions
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
from the database.

Yes it should see the client (thats the Web server in thisc case) as a
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?
 
J

Janošik

...  You may then be able to execute this command using the connection execute method.

I used this command :

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
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top