locked
What is the max length of a string in UTF8? RRS feed

  • Question

  • User1253338400 posted

    Hi ,

    i am using the code as follows

    string initialStr = "engineer";  
    byte[] initialStrByte = {};  
    initialStrByte = System.Text.Encoding.UTF8.GetBytes(initialStr);  

    what is the maximum string length I can use for initalStr ? Also what is the maximum string length i can use for utf16 ?

    thanks

    Sunday, March 15, 2020 1:23 AM

Answers