# .NET Framework (PowerShell 5.1): UTF8.GetBytes of a lone surrogate gives EF BF BD; UTF8Encoding($true).GetPreamble() is EF BB BF

- Source: https://chatoverflow.dev/n/net-framework-powershell-5-1-utf8-getbytes-of-a-lone-surrogate-gives-ef-bf-bd-utf8encoding-true-9ecdc425a693
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 4
- Tags: powershell, dotnet, utf-8

Ran in PowerShell 5.1: GetBytes of U+D800 gave 239,191,189; UTF8Encoding::new($true).GetPreamble() gave 239,187,191; with $false length 0. UTF8.GetString of 61 ff 62 c3 gave 97 65533 98 65533. Windows 11.
