From 4df3d0fa34c9f4459aded9f0f8887329a2f84c9c Mon Sep 17 00:00:00 2001 From: Yogthos Date: Sat, 27 Jun 2026 01:21:42 -0400 Subject: [PATCH] Add a java.util.Locale shim (no-op default locale) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit jolt's case ops are codepoint-based and locale-independent, so the default locale is a no-op token: getDefault/setDefault/forLanguageTag + ROOT/US/ENGLISH. honeysql sets and restores the locale around formatting to assert output is locale-stable (its Turkish-İ regression guard) — that test errored on the missing Locale/setDefault static, now passes (honeysql 635/8/1 -> 636/8/0). --- host/chez/java/host-static-methods.ss | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/host/chez/java/host-static-methods.ss b/host/chez/java/host-static-methods.ss index 8a98f6e..6850c2b 100644 --- a/host/chez/java/host-static-methods.ss +++ b/host/chez/java/host-static-methods.ss @@ -149,6 +149,15 @@ (cons "parseShort" (lambda (x . r) (parse-int-or-throw x (if (null? r) 10 (jnum->exact (car r))) "parseShort"))) (cons "toString" (lambda (x . r) (number->string (jnum->exact x)))))) +;; java.util.Locale — jolt's case ops are codepoint-based (locale-independent), so +;; the default locale is a no-op token. Libraries set/restore it around formatting +;; to prove output is locale-stable (honeysql's Turkish-İ regression guard). +(register-class-statics! "Locale" + (list (cons "getDefault" (lambda () "und")) + (cons "setDefault" (lambda (x) jolt-nil)) + (cons "forLanguageTag" (lambda (tag) (if (string? tag) tag (jolt-str-render-one tag)))) + (cons "ROOT" "und") (cons "US" "en-US") (cons "ENGLISH" "en"))) + (register-class-statics! "Boolean" (list (cons "parseBoolean" (lambda (s) (string=? "true" (ascii-string-down (if (string? s) s (jolt-str-render-one s)))))) (cons "TRUE" #t) (cons "FALSE" #f)))