0

I am trying to get proper response from .py script via jquery ajax method:

$.ajax({
                              url:'./pyscripts/word_zakup_odluka.py',
                              type:'POST',
                              datatype:'json',
                              data:JSON.stringify(json_odluka),
                              success:function(response){
                                pythonresponse=response['message']
                              }
                            })

.py script

print("Content-Type: application/json\n\n")
json_odluka=json.load(sys.stdin)
sys.stdout.write(json.dumps({'success:'true','message':json_odluka},indent=1))
sys.stdout.close()

Object I send via ajax is:

{opcinegrada: "općine ", opcinagrad: "općina ", opcinigradu: "općini ", opcinskogradsko: "općinsko", klasasuglasnost: "", …}

And I want to get the same object with ć character but instead I get:

{opcinegrada: "općine ", opcinagrad: "općina ", opcinigradu: "općini ", opcinskogradsko: "općinsko", klasasuglasnost: "", …}

Where and how can I set proper encoding in this case? Thank you in advance !

Goran
  • 127
  • 1
  • 10

0 Answers0