UTF-8 support for PostGRE SQL db

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/12/2006 1:40:29 AM
Gravatar
Total Posts 4

UTF-8 support for PostGRE SQL db

I've installed postgresql 2.1.6 mojoportal on windows 2003 and created postgresql db on Linux.
As I try to create new page with UTF-8 (Russian) name, I get the following exception:

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Npgsql.NpgsqlException: ERROR: 22021: invalid UTF-8 byte sequence detected near byte 0xcf

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:

[NpgsqlException: ERROR: 22021: invalid UTF-8 byte sequence detected near byte 0xcf]
mojoPortal.Data.dbPortal.PageSettings_Create(Int32 siteID, Int32 parentID, String pageName, String skin, Int32 pageOrder, String authorizedRoles, String editRoles, String createChildPageRoles, Boolean requireSSL, Boolean showBreadcrumbs, Boolean showChildPageBreadcrumbs, String pageKeyWords, String pageDescription, String pageEncoding, String additionalMetaTags, Boolean useUrl, String url, Boolean openInNewWindow, Boolean showChildPageMenu, Boolean hideMainMenu, Boolean includeInMenu, String menuImage) +3048
mojoPortal.Business.PageSettings.Create() +90
mojoPortal.Business.PageSettings.Save() +18
mojoPortal.Web.AdminUI.PageProperties.SavePageData() +2057
mojoPortal.Web.AdminUI.PageProperties.Apply_Click(Object Sender, EventArgs e) +13
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102


DB is created and supports basic operations in English locale
FYI, here is listing of created DB:

[root@testbed ~]# psql -l
        List of databases
    Name    |  Owner   | Encoding
------------+----------+----------
mojoportal | postgres | UTF8

Thanks in advance.
12/12/2006 4:38:54 AM
Gravatar
Total Posts 18439

Re: UTF-8 support for PostGRE SQL db

Hi,

That error seems to be raised from the Npgsql driver. I'm not running the very latest version so you could try obtaining the latest npgsql.dll and replace the one that shipped with mojoPortal and see if it is a bug that has been fixed.

There is also more information about Npgsql here:
http://npgsql.projects.postgresql.org/
and on this page:
http://npgsql.projects.postgresql.org/docs/manual/UserManual.htm

it shows connection string settings, you might try adding Encoding=unicode to your connection string

The scripts that ship with mojoPortal make the database use unicode not UTF8, I would think unicode would support Russian characters so why not try creating a db with unicode instead?

Hope it helps,

Joe
12/12/2006 9:33:36 AM
Gravatar
Total Posts 4

Re: UTF-8 support for PostGRE SQL db

Thanks,

Encoding=unicode

at connection string has solved the problem!   
12/18/2006 2:05:42 AM
Gravatar
Total Posts 488

Re: UTF-8 support for PostGRE SQL db

Joe,

could you please add ' Encoding=unicode' to the default connection string in web.config as it is already done in user.config.sample?
12/18/2006 4:02:08 AM
Gravatar
Total Posts 18439

Re: UTF-8 support for PostGRE SQL db

Yes, good idea.

Thanks,

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