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)))