diff --git a/head/schema-csharp-SystemTextJson/test/inputs/regressions/unicode-codepoint-length.schema/default/QuickType.cs b/head/schema-csharp-SystemTextJson/test/inputs/regressions/unicode-codepoint-length.schema/default/QuickType.cs
new file mode 100644
index 0000000..e9ba24e
--- /dev/null
+++ b/head/schema-csharp-SystemTextJson/test/inputs/regressions/unicode-codepoint-length.schema/default/QuickType.cs
@@ -0,0 +1,258 @@
+// <auto-generated />
+//
+// To parse this JSON data, add NuGet 'System.Text.Json' then do:
+//
+//    using QuickType;
+//
+//    var topLevel = TopLevel.FromJson(jsonString);
+#nullable enable
+#pragma warning disable CS8618
+#pragma warning disable CS8601
+#pragma warning disable CS8602
+#pragma warning disable CS8603
+
+namespace QuickType
+{
+    using System;
+    using System.Collections.Generic;
+
+    using System.Text.Json;
+    using System.Text.Json.Serialization;
+    using System.Globalization;
+
+    public partial class TopLevel
+    {
+        [JsonRequired]
+        [JsonPropertyName("exact")]
+        [JsonConverter(typeof(PurpleMinMaxLengthCheckConverter))]
+        public string Exact { get; set; }
+
+        [JsonRequired]
+        [JsonPropertyName("maximum")]
+        [JsonConverter(typeof(FluffyMinMaxLengthCheckConverter))]
+        public string Maximum { get; set; }
+
+        [JsonRequired]
+        [JsonPropertyName("minimum")]
+        [JsonConverter(typeof(TentacledMinMaxLengthCheckConverter))]
+        public string Minimum { get; set; }
+    }
+
+    public partial class TopLevel
+    {
+        public static TopLevel FromJson(string json) => global::System.Text.Json.JsonSerializer.Deserialize<TopLevel>(json, QuickType.Converter.Settings);
+    }
+
+    public static partial class Serialize
+    {
+        public static string ToJson(this TopLevel self) => JsonSerializer.Serialize(self, QuickType.Converter.Settings);
+    }
+
+    internal static partial class Converter
+    {
+        public static readonly JsonSerializerOptions Settings = new(JsonSerializerDefaults.General)
+        {
+            Converters =
+            {
+                new DateOnlyConverter(),
+                new TimeOnlyConverter(),
+                IsoDateTimeOffsetConverter.Singleton
+            },
+        };
+    }
+
+    internal class PurpleMinMaxLengthCheckConverter : JsonConverter<string>
+    {
+        public override bool CanConvert(Type t) => t == typeof(string);
+
+        public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+        {
+            var value = reader.GetString();
+            if (System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) >= 2 && System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) <= 2)
+            {
+                return value;
+            }
+            throw new JsonException("Cannot unmarshal type string");
+        }
+
+        public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
+        {
+            if (System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) >= 2 && System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) <= 2)
+            {
+                JsonSerializer.Serialize(writer, value, options);
+                return;
+            }
+            throw new NotSupportedException("Cannot marshal type string");
+        }
+
+        public static readonly PurpleMinMaxLengthCheckConverter Singleton = new PurpleMinMaxLengthCheckConverter();
+    }
+
+    internal class FluffyMinMaxLengthCheckConverter : JsonConverter<string>
+    {
+        public override bool CanConvert(Type t) => t == typeof(string);
+
+        public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+        {
+            var value = reader.GetString();
+            if (System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) <= 1)
+            {
+                return value;
+            }
+            throw new JsonException("Cannot unmarshal type string");
+        }
+
+        public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
+        {
+            if (System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) <= 1)
+            {
+                JsonSerializer.Serialize(writer, value, options);
+                return;
+            }
+            throw new NotSupportedException("Cannot marshal type string");
+        }
+
+        public static readonly FluffyMinMaxLengthCheckConverter Singleton = new FluffyMinMaxLengthCheckConverter();
+    }
+
+    internal class TentacledMinMaxLengthCheckConverter : JsonConverter<string>
+    {
+        public override bool CanConvert(Type t) => t == typeof(string);
+
+        public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+        {
+            var value = reader.GetString();
+            if (System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) >= 2)
+            {
+                return value;
+            }
+            throw new JsonException("Cannot unmarshal type string");
+        }
+
+        public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
+        {
+            if (System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) >= 2)
+            {
+                JsonSerializer.Serialize(writer, value, options);
+                return;
+            }
+            throw new NotSupportedException("Cannot marshal type string");
+        }
+
+        public static readonly TentacledMinMaxLengthCheckConverter Singleton = new TentacledMinMaxLengthCheckConverter();
+    }
+    
+    public class DateOnlyConverter : JsonConverter<DateOnly>
+    {
+        private readonly string serializationFormat;
+        public DateOnlyConverter() : this(null) { }
+
+        public DateOnlyConverter(string? serializationFormat)
+        {
+                this.serializationFormat = serializationFormat ?? "yyyy-MM-dd";
+        }
+
+        public override DateOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+        {
+                var value = reader.GetString();
+                return DateOnly.Parse(value!);
+        }
+
+        public override void Write(Utf8JsonWriter writer, DateOnly value, JsonSerializerOptions options)
+                => writer.WriteStringValue(value.ToString(serializationFormat));
+    }
+
+    public class TimeOnlyConverter : JsonConverter<TimeOnly>
+    {
+        private readonly string serializationFormat;
+
+        public TimeOnlyConverter() : this(null) { }
+
+        public TimeOnlyConverter(string? serializationFormat)
+        {
+                this.serializationFormat = serializationFormat ?? "HH:mm:ss.fff";
+        }
+
+        public override TimeOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+        {
+                var value = reader.GetString();
+                return TimeOnly.Parse(value!);
+        }
+
+        public override void Write(Utf8JsonWriter writer, TimeOnly value, JsonSerializerOptions options)
+                => writer.WriteStringValue(value.ToString(serializationFormat));
+    }
+
+    internal class IsoDateTimeOffsetConverter : JsonConverter<DateTimeOffset>
+    {
+        public override bool CanConvert(Type t) => t == typeof(DateTimeOffset);
+
+        private const string DefaultDateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK";
+
+        private DateTimeStyles _dateTimeStyles = DateTimeStyles.RoundtripKind;
+        private string? _dateTimeFormat;
+        private CultureInfo? _culture;
+
+        public DateTimeStyles DateTimeStyles
+        {
+                get => _dateTimeStyles;
+                set => _dateTimeStyles = value;
+        }
+
+        public string? DateTimeFormat
+        {
+                get => _dateTimeFormat ?? string.Empty;
+                set => _dateTimeFormat = (string.IsNullOrEmpty(value)) ? null : value;
+        }
+
+        public CultureInfo Culture
+        {
+                get => _culture ?? CultureInfo.CurrentCulture;
+                set => _culture = value;
+        }
+
+        public override void Write(Utf8JsonWriter writer, DateTimeOffset value, JsonSerializerOptions options)
+        {
+                string text;
+
+
+                if ((_dateTimeStyles & DateTimeStyles.AdjustToUniversal) == DateTimeStyles.AdjustToUniversal
+                        || (_dateTimeStyles & DateTimeStyles.AssumeUniversal) == DateTimeStyles.AssumeUniversal)
+                {
+                        value = value.ToUniversalTime();
+                }
+
+                text = value.ToString(_dateTimeFormat ?? DefaultDateTimeFormat, Culture);
+
+                writer.WriteStringValue(text);
+        }
+
+        public override DateTimeOffset Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+        {
+                string? dateText = reader.GetString();
+
+                if (string.IsNullOrEmpty(dateText) == false)
+                {
+                        if (!string.IsNullOrEmpty(_dateTimeFormat))
+                        {
+                                return DateTimeOffset.ParseExact(dateText, _dateTimeFormat, Culture, _dateTimeStyles);
+                        }
+                        else
+                        {
+                                return DateTimeOffset.Parse(dateText, Culture, _dateTimeStyles);
+                        }
+                }
+                else
+                {
+                        return default(DateTimeOffset);
+                }
+        }
+
+
+        public static readonly IsoDateTimeOffsetConverter Singleton = new IsoDateTimeOffsetConverter();
+    }
+}
+#pragma warning restore CS8618
+#pragma warning restore CS8601
+#pragma warning restore CS8602
+#pragma warning restore CS8603
diff --git a/base/schema-csharp-SystemTextJson/test/inputs/schema/minmaxlength.schema/default/QuickType.cs b/head/schema-csharp-SystemTextJson/test/inputs/schema/minmaxlength.schema/default/QuickType.cs
index c147337..97e642e 100644
--- a/base/schema-csharp-SystemTextJson/test/inputs/schema/minmaxlength.schema/default/QuickType.cs
+++ b/head/schema-csharp-SystemTextJson/test/inputs/schema/minmaxlength.schema/default/QuickType.cs
@@ -107,7 +107,7 @@ namespace QuickType
                     return new InUnion { Double = doubleValue1 };
                 case JsonTokenType.String:
                     var stringValue = reader.GetString();
-                    if (stringValue.Length >= 3 && stringValue.Length <= 5)
+                    if (System.Linq.Enumerable.Count(stringValue!, c => !char.IsLowSurrogate(c)) >= 3 && System.Linq.Enumerable.Count(stringValue!, c => !char.IsLowSurrogate(c)) <= 5)
                     {
                         return new InUnion { String = stringValue };
                     }
@@ -125,7 +125,7 @@ namespace QuickType
             }
             if (value.String != null)
             {
-                if (value.String.Length >= 3 && value.String.Length <= 5)
+                if (System.Linq.Enumerable.Count(value.String!, c => !char.IsLowSurrogate(c)) >= 3 && System.Linq.Enumerable.Count(value.String!, c => !char.IsLowSurrogate(c)) <= 5)
                 {
                     JsonSerializer.Serialize(writer, value.String, options);
                     return;
@@ -144,7 +144,7 @@ namespace QuickType
         public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
         {
             var value = reader.GetString();
-            if (value.Length >= 3 && value.Length <= 5)
+            if (System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) >= 3 && System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) <= 5)
             {
                 return value;
             }
@@ -153,7 +153,7 @@ namespace QuickType
 
         public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
         {
-            if (value.Length >= 3 && value.Length <= 5)
+            if (System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) >= 3 && System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) <= 5)
             {
                 JsonSerializer.Serialize(writer, value, options);
                 return;
@@ -171,7 +171,7 @@ namespace QuickType
         public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
         {
             var value = reader.GetString();
-            if (value.Length >= 4 && value.Length <= 5)
+            if (System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) >= 4 && System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) <= 5)
             {
                 return value;
             }
@@ -180,7 +180,7 @@ namespace QuickType
 
         public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
         {
-            if (value.Length >= 4 && value.Length <= 5)
+            if (System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) >= 4 && System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) <= 5)
             {
                 JsonSerializer.Serialize(writer, value, options);
                 return;
@@ -198,7 +198,7 @@ namespace QuickType
         public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
         {
             var value = reader.GetString();
-            if (value.Length <= 5)
+            if (System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) <= 5)
             {
                 return value;
             }
@@ -207,7 +207,7 @@ namespace QuickType
 
         public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
         {
-            if (value.Length <= 5)
+            if (System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) <= 5)
             {
                 JsonSerializer.Serialize(writer, value, options);
                 return;
@@ -225,7 +225,7 @@ namespace QuickType
         public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
         {
             var value = reader.GetString();
-            if (value.Length >= 3)
+            if (System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) >= 3)
             {
                 return value;
             }
@@ -234,7 +234,7 @@ namespace QuickType
 
         public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
         {
-            if (value.Length >= 3)
+            if (System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) >= 3)
             {
                 JsonSerializer.Serialize(writer, value, options);
                 return;
@@ -252,7 +252,7 @@ namespace QuickType
         public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
         {
             var value = reader.GetString();
-            if (value.Length >= 3 && value.Length <= 6)
+            if (System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) >= 3 && System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) <= 6)
             {
                 return value;
             }
@@ -261,7 +261,7 @@ namespace QuickType
 
         public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
         {
-            if (value.Length >= 3 && value.Length <= 6)
+            if (System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) >= 3 && System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) <= 6)
             {
                 JsonSerializer.Serialize(writer, value, options);
                 return;
diff --git a/base/schema-csharp-SystemTextJson/test/inputs/schema/optional-const-ref.schema/default/QuickType.cs b/head/schema-csharp-SystemTextJson/test/inputs/schema/optional-const-ref.schema/default/QuickType.cs
index 19c6094..e7c3982 100644
--- a/base/schema-csharp-SystemTextJson/test/inputs/schema/optional-const-ref.schema/default/QuickType.cs
+++ b/head/schema-csharp-SystemTextJson/test/inputs/schema/optional-const-ref.schema/default/QuickType.cs
@@ -124,7 +124,7 @@ namespace QuickType
         public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
         {
             var value = reader.GetString();
-            if (value.Length >= 2 && value.Length <= 16)
+            if (System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) >= 2 && System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) <= 16)
             {
                 return value;
             }
@@ -133,7 +133,7 @@ namespace QuickType
 
         public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
         {
-            if (value.Length >= 2 && value.Length <= 16)
+            if (System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) >= 2 && System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) <= 16)
             {
                 JsonSerializer.Serialize(writer, value, options);
                 return;
diff --git a/base/schema-csharp-SystemTextJson/test/inputs/schema/optional-constraints.schema/default/QuickType.cs b/head/schema-csharp-SystemTextJson/test/inputs/schema/optional-constraints.schema/default/QuickType.cs
index a701f79..cd334d5 100644
--- a/base/schema-csharp-SystemTextJson/test/inputs/schema/optional-constraints.schema/default/QuickType.cs
+++ b/head/schema-csharp-SystemTextJson/test/inputs/schema/optional-constraints.schema/default/QuickType.cs
@@ -131,7 +131,7 @@ namespace QuickType
         public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
         {
             var value = reader.GetString();
-            if (value.Length >= 3 && value.Length <= 10)
+            if (System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) >= 3 && System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) <= 10)
             {
                 return value;
             }
@@ -140,7 +140,7 @@ namespace QuickType
 
         public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
         {
-            if (value.Length >= 3 && value.Length <= 10)
+            if (System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) >= 3 && System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) <= 10)
             {
                 JsonSerializer.Serialize(writer, value, options);
                 return;
diff --git a/base/schema-csharp-SystemTextJson/test/inputs/schema/renaming-bug.schema/default/QuickType.cs b/head/schema-csharp-SystemTextJson/test/inputs/schema/renaming-bug.schema/default/QuickType.cs
index 1d86e67..135ea5c 100644
--- a/base/schema-csharp-SystemTextJson/test/inputs/schema/renaming-bug.schema/default/QuickType.cs
+++ b/head/schema-csharp-SystemTextJson/test/inputs/schema/renaming-bug.schema/default/QuickType.cs
@@ -228,7 +228,7 @@ namespace QuickType
         public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
         {
             var value = reader.GetString();
-            if (value.Length >= 1)
+            if (System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) >= 1)
             {
                 return value;
             }
@@ -237,7 +237,7 @@ namespace QuickType
 
         public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
         {
-            if (value.Length >= 1)
+            if (System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) >= 1)
             {
                 JsonSerializer.Serialize(writer, value, options);
                 return;
diff --git a/base/schema-csharp-SystemTextJson/test/inputs/schema/schema-constraints.schema/default/QuickType.cs b/head/schema-csharp-SystemTextJson/test/inputs/schema/schema-constraints.schema/default/QuickType.cs
index 24d4322..197a55f 100644
--- a/base/schema-csharp-SystemTextJson/test/inputs/schema/schema-constraints.schema/default/QuickType.cs
+++ b/head/schema-csharp-SystemTextJson/test/inputs/schema/schema-constraints.schema/default/QuickType.cs
@@ -63,7 +63,7 @@ namespace QuickType
         public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
         {
             var value = reader.GetString();
-            if (value.Length >= 5 && value.Length <= 5)
+            if (System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) >= 5 && System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) <= 5)
             {
                 return value;
             }
@@ -72,7 +72,7 @@ namespace QuickType
 
         public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
         {
-            if (value.Length >= 5 && value.Length <= 5)
+            if (System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) >= 5 && System.Linq.Enumerable.Count(value!, c => !char.IsLowSurrogate(c)) <= 5)
             {
                 JsonSerializer.Serialize(writer, value, options);
                 return;
