Best way to shorten UTF8 string based on byte length

前端 未结 9 1424
感情败类
感情败类 2020-12-10 12:14

A recent project called for importing data into an Oracle database. The program that will do this is a C# .Net 3.5 app and I\'m using the Oracle.DataAccess connection libra

9条回答
  •  一个人的身影
    2020-12-10 12:21

    If a UTF-8 byte has a zero-valued high order bit, it's the beginning of a character. If its high order bit is 1, it's in the 'middle' of a character. The ability to detect the beginning of a character was an explicit design goal of UTF-8.

    Check out the Description section of the wikipedia article for more detail.

提交回复
热议问题