Other methods of getting the true length of UTF8 String?

  • ScottPletcher wrote:

    LEN() has always not counted trailing spaces.

    Yes, I know this and it's implied in the OP due to me explicitly comparing LEN to DATALENGTH and no even entertaining the former as a "solution". This is why for a varchar I would use DATALENGTH and for an nvarchar use DATALENGTH() / 2. As mentioned, that doesn't work for an UTF8.

    Adding a character at the end, and then "minusing" 1 from the LEN, however, hadn't even crossed my mind!

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

Viewing post 16 (of 15 total)

You must be logged in to reply to this topic. Login to reply