Doctrine escapes special chars, causing varchars to exceed maximum length #8879
-
Hi, I'm having a bit of an issue with encodings. Despite the connection being configured with the same encoding as the database (and tables, and column), doctrine escapes special chars (and accent letters) , causing VARCHARS (and other size-limited columns) to exceed their maximum capacity. For example To set the encoding for the connexion, I use the
Thanks in advance! Noah |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Like every time I finally decide to post a question in a forum, I find more information. It would seem that the encoding issue I'm talking about is, in fact, not an issue: However, the issue is a bit trickier than that. The max size of text fields was ensured by the Since I can't close/remove the discussion, sorry for the missunderstanding of the issue. |
Beta Was this translation helpful? Give feedback.
Like every time I finally decide to post a question in a forum, I find more information.
It would seem that the encoding issue I'm talking about is, in fact, not an issue:
\\u00e9
is correctly interpreted as a single character by the database engine.However, the issue is a bit trickier than that.
The max size of text fields was ensured by the
maxlength
attribute in frontend, and was not necessarily verified in backend. Browser count line-breaks as single character (\n
), whereas the HTTP Protocol requires them to be transfered with\r\n
, causing a potential length issue when the text field content reaches the maximum length and contains line-breaks.Since I can't close/remove the discussi…