From 856c7902575404908cfcf10fe1a8fc7bfce7d6c1 Mon Sep 17 00:00:00 2001 From: Hans Dijkema Date: Thu, 30 Apr 2026 16:34:21 +0200 Subject: [PATCH] wchar problem on windows solved. --- taglib-ffi.rkt | 4 ++++ taglib.rkt | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/taglib-ffi.rkt b/taglib-ffi.rkt index 9f5dfc5..0e80a44 100644 --- a/taglib-ffi.rkt +++ b/taglib-ffi.rkt @@ -115,6 +115,10 @@ (define-tag-c-lib taglib_file_new_type (_fun _string/utf-8 TagLib_File_Type -> _TagLib_File-pointer)) +; TagLib_File *taglib_file_new_type_wchar(const char *filename, TagLib_File_Type type); +(define-tag-c-lib taglib_file_new_type_wchar + (_fun _string/utf-16 TagLib_File_Type -> _TagLib_File-pointer)) + ; void taglib_file_free(TagLib_File *file); (define-tag-c-lib taglib_file_free (_fun _TagLib_File-pointer -> _void)) diff --git a/taglib.rkt b/taglib.rkt index 026ac2b..f2f52d2 100644 --- a/taglib.rkt +++ b/taglib.rkt @@ -76,12 +76,16 @@ (unless valid? (when (eq? (system-type 'os) 'windows) + (dbg-sound "Could not open file ~a, trying wchar version on windows" file) + (unless (eq? tag-file #f) + (taglib_file_free tag-file)) (set! tag-file (taglib_file_new_wchar file)) (if (eq? tag-file #f) (set! valid? #f) (set! valid? (taglib_file_is_valid tag-file))))) (unless valid? + (warn-sound "Could not open file ~a" file) (unless (eq? tag-file #f) (taglib_file_free tag-file) (set! tag-file #f)))