This project is read-only.

Problem with Hungarian characters in n2

Topics: Developer Forum
Mar 16, 2009 at 11:07 AM
Edited Mar 16, 2009 at 11:09 AM
Hi am having problem with Hungarian characters in N2. Two Hungarian characters (ő and ű) are converted to o and u in the web. At first I thought it was Tiny MCE problem, but it wasn't. Now I think it's something in N2. Any ideas?
Mar 16, 2009 at 9:32 PM
Sounds like you're describing a feature that removes non-english characters in urls. This behaviour is configurable.

Take a look at the default web.config. You can remove the existing rules using configuration:

Mar 17, 2009 at 12:00 PM
Edited Mar 17, 2009 at 12:02 PM
No my problem is not the URL characters. It's all the fields after the "Title field".  The title field displays all characters correct, but after that no matter what type of field "EditableTextBox" or "EditableFreeTextArea" the characters are converted from ő and ű to o and u.

I should also point out that the problem started when we moved the site from our dev server running msSQL to the liveserver running MySQL. All the tables have utf8_swedish_ci collation.

 If we do a insert into the database with phpMyAdmin then the caraters remains correct. We are running the global language implementation of N2.
Mar 17, 2009 at 7:11 PM
Odd. I actually managed to reproduce this on the demo site.

The first time a page is saved the characters are replaced the way you describe.
If I go back and change the same page the characters arn't replaced.

When I look at the post in fiddler I can see the ű is posted as %C5% and the ő is posted as %C5%91.

I'll ponder a bit and see if I can figure out a solution. You could look into response encoding, and experimenting without /app_browsers/* and see if it makes any difference.
Mar 18, 2009 at 12:48 PM
Hi! we finally manage to solve the problem and it was a three step procedure.

1. On the connection string, add "CharSet=utf8"
like this:
connectionString="Server=server;Database=database;User Id=user;Password=pass;CharSet=utf8;"

2. On N2/Edit/FramedMaster, add the following to the Header section.
<META http-equiv="Content-Type" content="text/html; charset=utf-8">

3 And then also to your Master page if you got one.

Mar 18, 2009 at 6:14 PM
Sweet =)