Weird encoding issue in Orchard web pages

2019-08-30 00:53发布

问题:

Lately, I got a really weird bug that it’s even hard to describe. We have a site created with Orchard in 2 servers, the dev server and the production-live server. In the dev server everything works perfectly. In the production server, if you are logged on the CMS, again everything works well. If you are not logged on though, like the actual visitors of the site are, then it’s nearly perfect. The problem is almost random and happens only in 1-2 places in the whole site (different places). There, the browser fails with the encoding of probably a single char and displays instead 2 question marks inside a rhomboid shape. I found a really great article about Unicode and UTF8 http://coding.smashingmagazine.com/2012/06/06/all-about-unicode-utf8-character-sets/ and from what I got from there, UTF8 in the browser fails to make sense of the numbers of a single char encoded in a different charset.

What I struggle to gasp is why we get the problem only in a couple of places, which don’t seem to have a connection whatsoever? Why on the one server and not on the other (both sites are set up identically)? Why it doesn’t happen when you are logged onthe CMS? And why they happen in random places that even change if we reload a problematic page. I mean the computers are not humans, who might translate and write something wrongly at a random time by mistake. They will either get it right or wrong. In this case the browser it displays almost everything right, apart form 1-2 characters (among thousands of other similar characters) in random pages. We managed to constrain the problem to the text inside the slides of projection widgets.

It looks like a problem of orchard and/or projection widget. It’s a really weird one, but I would appreciate any help or direction and especially any reasonable explanation of how something like that can occur.