Hi,
I have a website with a chat system. This chat system has a table 'messages' and one of the columns is 'messagetext' set to utf8_general_ci(MySQL). In my website, I use php to query database. The results are ok.
In my app, i use NodeJS as backend but the results are like that: " ασδασδ ". I store greek words in this column in utf8. ( ασδασδ this is the exact value on db but in php server is decoding to utf8 successfully).
I have tried iconv-lite,iconv,utf8 decode,decode Json.
I just noticed something. When I write Καλησπέρα in a form and then send it to db, the words in column are -> ΚαλησπÎÏα . I used a utf8 encoder/decoder and the actual utf8 encoding in the word Καλησπέρα is Î�αληÏ�Ï�ÎÏ�α . So the problem i think is decoding string to utf8. What do you think about it? How can i convert this ΚαλησπÎÏα to this Î�αληÏ�Ï�ÎÏ�α ? You can try this here: http://cafewebmaster.com/online_tools/utf_decode. Write Καλησπέρα, encode this and then decode. You will see that the result is different from the stored result in db -> ΚαλησπÎÏα.
I can't decode this ΚαλησπÎÏα from node js using utf8 to this Καλησπέρα to show up in the app, i get only the value ΚαλησπÎÏα as response from nodejs. When i use utf.decode with ΚαλησπÎÏα it shows -> Invalid continuation byte
What can I do?
Hi,
I have a website with a chat system. This chat system has a table 'messages' and one of the columns is 'messagetext' set to utf8_general_ci(MySQL). In my website, I use php to query database. The results are ok.
In my app, i use NodeJS as backend but the results are like that: " ασδασδ ". I store greek words in this column in utf8. ( ασδασδ this is the exact value on db but in php server is decoding to utf8 successfully).
I have tried iconv-lite,iconv,utf8 decode,decode Json.
I just noticed something. When I write Καλησπέρα in a form and then send it to db, the words in column are -> ΚαλησπÎÏα . I used a utf8 encoder/decoder and the actual utf8 encoding in the word Καλησπέρα is Î�αληÏ�Ï�ÎÏ�α . So the problem i think is decoding string to utf8. What do you think about it? How can i convert this ΚαλησπÎÏα to this Î�αληÏ�Ï�ÎÏ�α ? You can try this here: http://cafewebmaster.com/online_tools/utf_decode. Write Καλησπέρα, encode this and then decode. You will see that the result is different from the stored result in db -> ΚαλησπÎÏα.
I can't decode this ΚαλησπÎÏα from node js using utf8 to this Καλησπέρα to show up in the app, i get only the value ΚαλησπÎÏα as response from nodejs. When i use utf.decode with ΚαλησπÎÏα it shows -> Invalid continuation byte
What can I do?