We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

toArray() is not working with latin1 charset

HI There,

toArray function is not working with latin1 charset. it is working fine with utf8 charset. Why? Is there any phalcon functions to work with latin1 charset?

toArray has nothing to do with character encoding. What is your exact error? Describing it / pasting in output would help us a lot


look at your db log, there is probably a special char that is causing trouble, like a quote, double quote, and making the query failing


HI There, In my database there is some data is in special charactor with latin1 charset.so when i use toArray(), it will produce nothing. But when i remove that special charctor then it will product output as expected.so there must be charset issues with toArray() function.

When i convert my data into utf-8 charset it will produce output as expected. There is no error in my coding ;)

@Graphmatic, I did everything from checking to db log files. but i got the result while converting it to utf-8 charset. in my database there is so many special charactors.