Appropriate character encoding / sorting for storing urls?

My web application stores segments of URLs in the database. These URL segments are based on user-generated content.

What sorting should be used for character strings to be displayed in URLs?

My guess is ASCII General CI (?) Based on this question: What characters make URLs invalid?

+4
source share
1 answer

Actually, it doesn't matter as far as I can tell. The characters that are valid in the URL are represented in any character set that I know of, and I would not use different mappings between tables and columns - you will encounter problems of "illegal collage combination" when you try to join them or perform any other kind of operation with multiple columns or crosstab (see my recent problem here ).

Correct me if I am wrong, of course.

+2
source

Source: https://habr.com/ru/post/1302523/


All Articles