Problem with full name written in russian

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
12/6/2006 7:09:39 AM
Gravatar
Total Posts 488

Re: Problem with full name written in russian

When I try to write full name (under my profile) in russian letters, after saving changes they become "?????". It is so on mojoportal.com

When I try the same on my local computer (yesterday's version from branches/joesandbox2), it is saved correctly. But after logout/login on the top of the screen it is displayed incorrect (something wrong with encodings).

P.S. I run mojoPortal on SQL Server 2000.
12/6/2006 9:02:00 AM
Gravatar
Total Posts 18439

Re: Problem with full name written in russian

I suspect that the problem on this site is because my MySQL database was created with:

CREATE DATABASE `mojoprod` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;

I did not do this intentionally. I think the correct way would be to use unicode for the character set.

Maybe a similar problem with MS SQL on your local machine.

Joe
12/6/2006 9:54:34 PM
Gravatar
Total Posts 488

Re: Problem with full name written in russian

On my local machine (using SQL Server) the name in russian letters is shown correctly in the following places:
/Secure/UserProfile.aspx
/MemberList.aspx
/ProfileView.aspx
Only at the top of the screen it is displayed incorrect (2 strange characters instead of each russian one).
So I do not think the database to be the cause of this particular problem. It's something wrong with the code producing the label.

On mojoportal.com "?" is stored instead of russian letters and "?" are shown in all the places mentioned above. So, in this case it seems to be the database issue.
May be, it would be nice to change database creation scripts to force it use unicode?
12/7/2006 1:48:15 AM
Gravatar
Total Posts 18439

Re: Problem with full name written in russian

Yes we probably should specify unicode in the database creation script, I will follow up on that. However in many cases in hosting environments a database is created for you and you never run that script.
12/7/2006 2:05:02 AM
Gravatar
Total Posts 488

Re: Problem with full name written in russian

Once again.
In my case the problem is not in the database, as in all the other places everything is displayed correct.
As I can see from the code, display name for the wellcome message on the top is stored in cookies. I watched my cookies and saw that it is incorrectly put there. That's why it is incorrectly displayed.
12/7/2006 2:06:14 AM
Gravatar
Total Posts 18439

Re: Problem with full name written in russian

Yes, I forgot to say I will look into that one.

Thanks,

Joe
12/7/2006 2:16:44 AM
Gravatar
Total Posts 18439

Re: Problem with full name written in russian

Since the characters are stored raw in the db without any encoding applied I think they are in the cookie the same way. I just committed a change that will HtmlEncode the cookie value before displaying it. Can you tell me if this fixes it?

Thanks,

Joe
12/7/2006 2:34:34 AM
Gravatar
Total Posts 488

Re: Problem with full name written in russian

No, that did not help.

As far as I understand, cookies are not unicode, so when trying to write unicode russian letters from .Net string the string is corrupted.
I see 2 possible solutions:
1. Somehow encode the name to place it there (some kind of binary serialization?)
2. Not to store the name in cookies.
12/7/2006 2:43:06 AM
Gravatar
Total Posts 18439

Re: Problem with full name written in russian

I just committed another change that will HtmlEncode the value before putting it in the cookie. Can you get latest, clear all cookies and try again to see if this solves it?

Thanks,

Joe
12/7/2006 2:59:39 AM
Gravatar
Total Posts 488

Re: Problem with full name written in russian

No, it doesn't.

I tried HttpUtility.UrlEncode() on saving and HttpUtility.UrlDecode() on reading - that helped.
12/7/2006 3:11:19 AM
Gravatar
Total Posts 18439

Re: Problem with full name written in russian

Ok, I just committed another change that doesn't put the name in the cookie but gets it directly from the siteUser object. Can you test this?

Thanks,

Joe
12/7/2006 3:19:12 AM
Gravatar
Total Posts 488

Re: Problem with full name written in russian

Of course, this works. As it doesn't use cookies. (I have tested)
If you still want to use cookies, I have written the solution for cookies above.
12/7/2006 3:32:12 AM
Gravatar
Total Posts 18439

Re: Problem with full name written in russian

Well, it seems unconventional to use UrlEncode there. Since we are always putting the siteUser object in the http context for authenticated requests we might as well go with the cookieless approach.

Joe
12/7/2006 10:21:14 AM
Gravatar
Total Posts 18439

Re: Problem with full name written in russian

I changed the charset/collation on my db to utf-8. Can you try modifying your name with Russian characters again and see if that fixed it for this site?

Thanks,

Joe
12/7/2006 11:06:55 AM
Gravatar
Total Posts 18439

Re: Problem with full name written in russian

Nevermind I ran into errors after that change and had to change it back. I'll experiment with a local copy and see if I can figure it out.

Thanks,

Joe
You must sign in to post in the forums. This thread is closed to new posts.