2

I'm having a lot of problems with properly processing certain special characters in my application.

Here's what I'm doing at the moment:

  1. User enters a location, data is retrieved via the Google Geolocation API (full name, lat and lon) and is sent via ajax (as a JSON string) to a python script
  2. The python script parses the JSON string, reads the parameters and executes a http request to an API, which runs on nodejs
  3. Data is inserted into MongoDB

The problem is when there's a special character in the location name. The original location name I'm testing on has the character è. When the json is parsed in Python I get a \xc9 and after the process completes I always end up with a completely different (mostly invalid) character in the database than what was originally entered. I've tried all sorts of encoding and decoding (mostly from similar questions on stackoverflow), but I don't properly understand what exactly I should do.

Any tips would be appreciated. Thanks!

1 Answer 1

1

Have you tried var myEncodedString = encodeURIComponent('your string or whatever'); in your js code

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.