A
A
Adel1ne2015-06-08 08:40:11
JavaScript
Adel1ne, 2015-06-08 08:40:11

Floating error json_encode(): Invalid UTF-8 sequence in argument when passing argument via ajax (Yii2 framework)?

Hello.
Framework Yii2. I pass the argument via Ajax (dataType: json) to the getcn action of the main controller.

I came across a strange error:

$.ajax({
   url: '?r=main/getcn&objectclass=' + objectclass,
   dataType: "json",
   success: function(data) {
      $('#test').text(data.result);
   }            
});


values ​​of the form are passed to the objectclass variable : 7017-00-330 7017-01-386 7017-01-989 7017-02-109 For some unknown reason, most of the values ​​generate an error: json_encode(): Invalid UTF-8 sequence in argument , the rest are transmitted normally. For example, 7017-01-267, 7017-00-724, 7017-00-414, 7017-00-324, 7017-00-421 are transmitted without error. A 7017-00-330, 7017-01-386, 7017-01-989, 7017-02-109, 7017-00-212 with the above error. What is mysticism?



Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question