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

I have a problem with displaying the characters Ε‘ and ΕΎ in the frontend when I insert it as the text string data type inside Umbraco 4.7.1. Umbraco uses the MySql database.

I noticed that this is not a problem when I save these characters with a rich text editor. I looked at the database and all the values ​​of the advanced text editor are stored in XML inside CDATA, but the text string data type is not inside CDATA.

All other Bosnian specific characters (čćđ) are encoded html as čćđ, but Ε‘ and ΕΎ are stored as s and z.

When I try to change the textstring database data type to ntext instead of varchar, it works (because it is stored in CDATA), but I cannot do this because then I will lose all my existing data.

My HTML encoding iso-8859-1.

What to do here?

+4
source share
3 answers

Oddly enough, I was discussing the Croatian alphabet (in a non-computational context) with someone recently, and they gave me the pearl of a link that talks about the Croatian alphabet:

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

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

Changing the 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

+4
source

In fact, Windows-1251 helped. It encodes the desired characters.

0
source

After some time, it turned out that I can use the default encoding (UTF8), but I need to change the database sortings. So I changed the sortings to every column table that had varchar or ntext, and now it works completely, and this is the best solution I have found so far.

0
source

Source: https://habr.com/ru/post/1435768/


All Articles