diff --git a/pkgs/racket-test-core/tests/racket/unicode.rktl b/pkgs/racket-test-core/tests/racket/unicode.rktl index b90757b298..da9e2b9b8f 100644 --- a/pkgs/racket-test-core/tests/racket/unicode.rktl +++ b/pkgs/racket-test-core/tests/racket/unicode.rktl @@ -1662,5 +1662,32 @@ (test "\u039A\u03b1\u03BF\u03C3\u03C2" string-titlecase "\u039A\u0391\u039F\u03A3\u03A3") (test "\u039A\u03b1\u03BF\u03C2 X" string-titlecase "\u039A\u0391\u039F\u03A3 x") +;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Bytes converters and custodians - check that built-in conversions are +;; not registered + +(let ([c (make-custodian)]) + (parameterize ([current-custodian c]) + (define converters + (append + (list + (bytes-open-converter "UTF-8" "UTF-8") + (bytes-open-converter "UTF-8-permissive" "UTF-8")) + (if (eq? 'unix (system-type)) + null + (list + (bytes-open-converter "" "UTF-8") + (bytes-open-converter "UTF-8" ""))) + (list + (bytes-open-converter "platform-UTF-8" "platform-UTF-16") + (bytes-open-converter "platform-UTF-8-permissive" "platform-UTF-16") + (bytes-open-converter "platform-UTF-16" "platform-UTF-8") ))) + (custodian-shutdown-all c) + ;; Make sure the convertes all still work --- not shut down by + ;; the custodian + (for ([cvt (in-list converters)]) + (bytes-convert cvt #"hello")))) + +;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (report-errs) diff --git a/racket/src/racket/src/string.c b/racket/src/racket/src/string.c index 69b6a9c7dc..b1504fe966 100644 --- a/racket/src/racket/src/string.c +++ b/racket/src/racket/src/string.c @@ -4206,7 +4206,7 @@ Scheme_Object *scheme_open_converter(const char *from_e, const char *to_e) else permissive = 0; cd = NULL; - need_regis = (*to_e && *from_e); + need_regis = 0; } else if ((!strcmp(from_e, "platform-UTF-8") || !strcmp(from_e, "platform-UTF-8-permissive")) && !strcmp(to_e, "platform-UTF-16")) {