Sitecore and Json Serialization - Strange Conversion

I have the following problems:

On my local, Azure + 3 other servers, my mapping code looks at the latitude and longitude coordinates that are stored in the Sitecore element.

On my new QA and PROD Sitecore servers, which I have not used before as they sit on a new hosting provider, I have the following problem:

If you look at the picture below: enter image description here

The coordinates are stored correctly, but the end result when serialized from Json looks like this: enter image description here

Anyone have any ideas why the decimal point would be removed?

as I said the code works in many different environments, so I think the new hosting provider has installed something that is different from my other working environment.

I'll investigate further, but thought I'd put it there.

+3


source to share


2 answers


The answer is:

Change this:

<globalization requestEncoding="utf-8" responseEncoding="utf-8" />

      



:

<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-AU" uiculture="en" />

      

0


source


Perhaps this is a matter of culture. Make sure the correct culture is set in the web.config file or page.

Hint: If you want to install the Culture from the Sitecore language context, here's how:



Thread.CurrentThread.CurrentCulture = Context.ContentLanguage.CultureInfo;

      

+2


source







All Articles