Alvaro Herrera <alvhe...@2ndquadrant.com> writes: > More or less. If you don't add these chars, mbcliplen doesn't think > there's character there, so it ends up not adding the ellipsis. (I > don't remember why it has to be two chars rather than just one.)
I think the idea is to be sure that there's a full multibyte character after the truncation point; if the truncation point is within a multibyte character, then you might have only a partial multibyte character after that, which could cause problems. Doing it this way, mbcliplen will never look at the last possibly-truncated character. regards, tom lane