diff --git a/cmdutils.c b/cmdutils.c
index 3543edd..f811566 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -244,7 +244,7 @@ static void prepare_app_arguments(int *argc_ptr, char ***argv_ptr)
 
     /* determine the UTF-8 buffer size (including NULL-termination symbols) */
     for (i = 0; i < win32_argc; i++)
-        buffsize += WideCharToMultiByte(CP_UTF8, 0, argv_w[i], -1,
+        buffsize += WideCharToMultiByte(CP_OEMCP, 0, argv_w[i], -1,
                                         NULL, 0, NULL, NULL);
 
     win32_argv_utf8 = av_mallocz(sizeof(char *) * (win32_argc + 1) + buffsize);
@@ -256,7 +256,7 @@ static void prepare_app_arguments(int *argc_ptr, char ***argv_ptr)
 
     for (i = 0; i < win32_argc; i++) {
         win32_argv_utf8[i] = &argstr_flat[offset];
-        offset += WideCharToMultiByte(CP_UTF8, 0, argv_w[i], -1,
+        offset += WideCharToMultiByte(CP_OEMCP, 0, argv_w[i], -1,
                                       &argstr_flat[offset],
                                       buffsize - offset, NULL, NULL);
     }
diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 0c2eca0..6d96ec2 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -132,10 +132,10 @@ dshow_read_close(AVFormatContext *s)
 static char *dup_wchar_to_utf8(wchar_t *w)
 {
     char *s = NULL;
-    int l = WideCharToMultiByte(CP_UTF8, 0, w, -1, 0, 0, 0, 0);
+    int l = WideCharToMultiByte(CP_OEMCP, 0, w, -1, 0, 0, 0, 0);
     s = av_malloc(l);
     if (s)
-        WideCharToMultiByte(CP_UTF8, 0, w, -1, s, l, 0, 0);
+        WideCharToMultiByte(CP_OEMCP, 0, w, -1, s, l, 0, 0);
     return s;
 }
 
