Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 604
Adinp Avatar asked Sep 23 '12 15:09

Adinp


1 Answers

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.

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

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

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

like image 52
Goran Mottram Avatar answered Oct 15 '22 09:10

Goran Mottram