How to setup encoding for Bosnian (or Croatian or Slovenian) characters set using MySql and Umbraco 4.7.1
Asked Answered
S

3

6

I am having problem displaying characters š and ž on frontend when I insert it as textstring data type inside Umbraco 4.7.1. Umbraco uses MySql database.

I noticed that this is not the problem when I save those characters with a rich text editor. I looked at the database and all rich text editor values are stored in the XML inside CDATA, but textstring data type isn't inside CDATA.

All other Bosnian specific characters (čćđ) are html encoded as čćđ but š and ž are saved as s and z.

When i try to change textstring database data type to ntext instead of varchar, it works (because it stores in CDATA) but i can not do that because then I will lose all of my existing data.

My HTML encoding charset is iso-8859-1.

What to do here?

Swor answered 23/9, 2012 at 15:29 Comment(0)
A
8

Funnily enough, I was discussing the Croatian alphabet (in a non-computing context) with someone recently and they gave me a gem-of-a-link, which states the following with regards to the Croatian alphabet:

The 8-bit ISO 8859-2 (Latin-2) standard was developed by ISO. 1

The ISO 8859-1 2 only has partial support for languages that use a similar character set,
whilst ISO 8859-2 3 provides full support for Bosnian, Croatian and many other languages.

Changing your encoding should fix the problem.

1 http://en.wikipedia.org/wiki/Gaj%27s_Latin_alphabet#Computing

2 http://en.wikipedia.org/wiki/ISO_8859-1

3 http://en.wikipedia.org/wiki/ISO_8859-2

Amass answered 24/9, 2012 at 10:52 Comment(0)
S
0

Actually windows-1251 helped. It encodes wanted characters.

Swor answered 26/9, 2012 at 8:27 Comment(0)
S
0

After a while I figured out that I can use default encoding (UTF8), but I have to change database collations. So I changed collations on every table column that had varchar or ntext and now it works fully and that is the best solution I found so far.

Swor answered 6/12, 2013 at 0:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.