.NET Fiddle

CSharp · Console

/Program.cs

using System;
					
public class Program
{
	public static void Main()
	{
		foreach (var s in new []{ "0", "a", " ", "♥", "я", "な", "平", "한", "🤡"}) {
			Console.WriteLine("{0,3}\t{1}", s, GetByteLength(s));
		}
	}
	
    public static int GetByteLength(string text) => System.Text.Encoding.UTF8.GetBytes(text).Length;
}
;