Should we HTML-encode special characters before storing them in the database?

后端 未结 6 1982
故里飘歌
故里飘歌 2020-12-03 13:36

I use MySQL to store data and my web pages are all encoded as UTF-8. I have a lot of Portuguese characters such as ç and õ and I\'m wondering if I

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-03 13:47

    Do you ever need to search for them? I'm not a MySQL expert but you may have to jump thru hoops to do searches.

    Are you concerned about the HTML-ness of the data or the character encoding?

    I would say try not to do any special encoding of characters in the DB if you can avoid it. Searching, having to remember special in-bound/out-bound processing, etc.

提交回复
热议问题