6 Replies - 8201 Views - Last Post: 24 January 2006 - 10:31 AM Rate Topic: -----

#1 liwh0re  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 23-January 06

mysql, asp.net (C#) and hebrew. need help.

Posted 23 January 2006 - 07:18 PM

Hi, I have a webpage in asp.net which connect to mysql 4.1 db.

This page can view/add/edit data from a table in my db.

When I run this page locally and view/add/edit data in hebrew, it displays just fine.

But when I upload my project to my web server (web server and mysql db are from the same hosting company, which is a non Israeli company) and try to view/add/edit data in hebrew, it all comes out as question marks (?????)

When I check with the specific table in phpMyAdmin, I can see that the data I added using the page locally (the way it works) is shown in gibberish (ðñéåï - but I think its 'good' gibberish, because it is readable in my local page). If I try to add data using the same page on the server, it shows in phpMyAdmin as question marks (???).

The collation is set to UTF8_unicode_ci.

I've tried to use encoding coversion in my code, i've tried changing the deefault encoding. nothing works.

I suspect the problem lies in the hosting company's web server bcz the same code works fine locally on my computer, but doesn't on their server. I just don't know what is wrong with their server.

Could it be something that needs to be defined in Mysql?

If anyone knows how to make this work, please let me know. I've been battling this issue for 2 weeks now and still havn't advanced.

Is This A Good Question/Topic? 0
  • +

Replies To: mysql, asp.net (C#) and hebrew. need help.

#2 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,507
  • Joined: 12-July 02

Re: mysql, asp.net (C#) and hebrew. need help.

Posted 23 January 2006 - 08:20 PM

If I'm reading this correctly, it may well be a problem on the server, but just to be sure, have to tried one of the following:
  • Storing the sentences as string literals in a text field?
  • Storing the characters as their unicode values?
I know I ran into this problem before (different language)...let me see if I can dig up the answer.

I know that when you create the table in MySQL, you can specify the character set...and if I'm not mistaken, MySQL can set the character set to hebre...it is actually specified as such. So when creating the table, you might specify it as

CREATE TABLE mytable (
 ...
) CHARACTER SET hebrew;


You should be able to see all available character sets for MySQL with this query:
SHOW CHARACTER SET;

Was This Post Helpful? 0
  • +
  • -

#3 sontek  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 8
  • View blog
  • Posts: 283
  • Joined: 13-September 01

Re: mysql, asp.net (C#) and hebrew. need help.

Posted 23 January 2006 - 09:40 PM

I'm not very familiar with development using other languages but one cause might be be that you're using character codes and they are showing up while you're testing but when you actually compile and release it to the server it is not saved as UTF-8... if you open up your .cs file and then click "File-Save As.." there is a little arrow next to the save button.. Click that and then click "Save with Encoding" I've included a screenshot..

Attached image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#4 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,507
  • Joined: 12-July 02

Re: mysql, asp.net (C#) and hebrew. need help.

Posted 23 January 2006 - 09:42 PM

Good thought, but the problem may well be the way the fields in the database are structured with regards to character sets...mysql requires alternate character sets to be specified.
Was This Post Helpful? 0
  • +
  • -

#5 liwh0re  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 23-January 06

Re: mysql, asp.net (C#) and hebrew. need help.

Posted 24 January 2006 - 09:33 AM

Thank you both for the very fast replies. I will try your suggestions.

Meanwhile I'd just like to add that the heberw text in my page which is part of the page (and doesn't come from the db) displays just fine (i.e: labels on buttons, table headers, etc.)

About saving the file as unicode (save with encoding): Does it really have any effect when I upload it to the server? bcz the way I upload is I first click on Build->Publish website, and the outcome is of course the compiled dlls, and if I view the .aspx files themselves, all they actually contain is thsi text:

This is a marker file generated by the precompilation tool, and should not be deleted!

So, is saving with encoding affects anything?
Was This Post Helpful? 0
  • +
  • -

#6 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,507
  • Joined: 12-July 02

Re: mysql, asp.net (C#) and hebrew. need help.

Posted 24 January 2006 - 09:50 AM

I'm not convinced it will help your situation, but you can give it a try. the character sets in MySQL may be more of a solution, as that is the text effected.
Was This Post Helpful? 0
  • +
  • -

#7 sontek  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 8
  • View blog
  • Posts: 283
  • Joined: 13-September 01

Re: mysql, asp.net (C#) and hebrew. need help.

Posted 24 January 2006 - 10:31 AM

Yeah, I'm not familiar with how mysql does things or with multilingual development, I just know if you don't save your source code with proper encoding the compiler will replace it with a character it thinks best fits, which in this case might be a bunch of question marks :P But it sounds like amadeus as a lot more experience with this than I do so I'd go with him!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1