search
尋找貓咪~QQ 地點 桃園市桃園區 Taoyuan , Taoyuan

C# 正確抓出/計算 UTF8字串長度 – jashliao部落格

C# 正確抓出/計算 UTF8字串長度

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CS_UTF8
{
    class Program
    {
        static void Main(string[] args)
        {
            String StrEN, StrTW, StrCN;
            StrEN = "English name";
            StrTW = "英文名稱";
            StrCN = "英文名称";
            byte[] buf01 = Encoding.UTF8.GetBytes(StrEN);//12 byte
            byte[] buf02 = Encoding.UTF8.GetBytes(StrTW);//12 byte
            byte[] buf03 = Encoding.UTF8.GetBytes(StrCN);//12 byte


        }
    }
}



熱門推薦

本文由 jashliaoeuwordpress 提供 原文連結

寵物協尋 相信 終究能找到回家的路
寫了7763篇文章,獲得2次喜歡
留言回覆
回覆
精彩推薦