Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Length Of Data With German Umlauts In Utf-8

forums forums SQLyog Using SQLyog Length Of Data With German Umlauts In Utf-8

  • This topic is empty.
Viewing 1 reply thread
  • Author
    Posts
    • #30609
      Mahesh
      Member

      This is MySQL question instead SQLyog.

      Length()function Returns the length of the string str, measured in bytes. A multi-byte character counts as multiple bytes. This means that for a string containing five two-byte characters, LENGTH() returns 10, whereas CHAR_LENGTH() returns 5.

      http://dev.mysql.com/doc/refman/4.1/en/string-functions.html#function_length

      In your case :

      select length('123ä');

      Output:

      5

      but for

      select CHAR_LENGTH('123ä');

      Output:

      4

      Because “ä” is a multibyte character.

    • #30610
      larsen
      Participant
      'Mahesh' wrote on '19:

      This is MySQL question instead SQLyog.

      I never said it was a SQLyog question =)

      Quote:
      Length()function Returns the length of the string str, measured in bytes. A multi-byte character counts as multiple bytes. This means that for a string containing five two-byte characters, LENGTH() returns 10, whereas CHAR_LENGTH() returns 5.

      thx! i didn´t knew there was a specific function for that case.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.