Special apostrophe breaks JSON

user138720
[7671] => Sleaford Carre’s

is an element in $result

$result=  json_encode($result);
echo $result;
//outputs
"7671":null,

Please note that this is not a normal apostrophe (single quote) or a back tick. I cant even find it on my keyboard. Data comes from a Latin-1 table.

I have also noticed that using htmlentities on building the array will dissapear the string from the array. What am I to do??

user138720

As no-one has actually written an answer, read the comments:)

as the others have said, use utf8_encode() then json_encode(). – Brian

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Remove special apostrophe in R

From Dev

Remove special apostrophe in R

From Dev

Replace special character apostrophe with normal apostrophe

From Dev

Replace special character apostrophe with normal apostrophe

From Dev

Ajax post breaks with special characters

From Dev

json.loads not replacing apostrophe

From Dev

Special character replacement from code of the apostrophe in a file name path

From Dev

Editing JSP in eclipse breaks special characters?

From Dev

Special characters in cue files: shnsplit breaks

From Dev

Retain Special Characters In A String (Without Breaks)

From Dev

Php Cant insert Json data with apostrophe to database

From Dev

JSON parse string having Apostrophe (Single Quote)

From Dev

GET with body (json format), what to do with apostrophe?

From Dev

How to json_decode invalid JSON with apostrophe instead of quotation mark

From Dev

Python breaks parsing json with characters \"

From Dev

& character breaks received json by php

From Dev

JSON formatting clarification line breaks

From Dev

Google CSE: breaks when I search with special characters like "é"

From Dev

D3 link breaks during special removal case

From Dev

Google CSE: breaks when I search with special characters like "é"

From Dev

Special Characters in json file

From Dev

PHP JSON Special Characters

From Dev

Json encode and special characters

From Dev

I'm trying to query the customer name with an apostrophe but it looks like a special character?

From Dev

Remove special character and apostrophe and unwanted space in string using re.sub function in python

From Dev

Parsing active record object to json with escape of single quote (apostrophe)

From Java

Deserializing JSON with special characters into a string

From Dev

spray json attribute with special char

From Dev

How to parse special characters in json?

Related Related

  1. 1

    Remove special apostrophe in R

  2. 2

    Remove special apostrophe in R

  3. 3

    Replace special character apostrophe with normal apostrophe

  4. 4

    Replace special character apostrophe with normal apostrophe

  5. 5

    Ajax post breaks with special characters

  6. 6

    json.loads not replacing apostrophe

  7. 7

    Special character replacement from code of the apostrophe in a file name path

  8. 8

    Editing JSP in eclipse breaks special characters?

  9. 9

    Special characters in cue files: shnsplit breaks

  10. 10

    Retain Special Characters In A String (Without Breaks)

  11. 11

    Php Cant insert Json data with apostrophe to database

  12. 12

    JSON parse string having Apostrophe (Single Quote)

  13. 13

    GET with body (json format), what to do with apostrophe?

  14. 14

    How to json_decode invalid JSON with apostrophe instead of quotation mark

  15. 15

    Python breaks parsing json with characters \"

  16. 16

    & character breaks received json by php

  17. 17

    JSON formatting clarification line breaks

  18. 18

    Google CSE: breaks when I search with special characters like "é"

  19. 19

    D3 link breaks during special removal case

  20. 20

    Google CSE: breaks when I search with special characters like "é"

  21. 21

    Special Characters in json file

  22. 22

    PHP JSON Special Characters

  23. 23

    Json encode and special characters

  24. 24

    I'm trying to query the customer name with an apostrophe but it looks like a special character?

  25. 25

    Remove special character and apostrophe and unwanted space in string using re.sub function in python

  26. 26

    Parsing active record object to json with escape of single quote (apostrophe)

  27. 27

    Deserializing JSON with special characters into a string

  28. 28

    spray json attribute with special char

  29. 29

    How to parse special characters in json?

HotTag

Archive