#5398 closed defect (fixed)
non-Latin characters in Windows console
Reported by: | v0lt | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avutil |
Version: | git-master | Keywords: | win32 |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Can not read the names of the DirectShow audio device in Windows 7 with the Russian locale.
How to reproduce:
c:\>ffmpeg -list_devices true -f dshow -i dummy ffmpeg version N-79209-gb3eda69 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 5.3.0 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca -- enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-lib modplug --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable- libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enabl e-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable -libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --ena ble-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx 264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable -lzma --enable-decklink --enable-zlib libavutil 55. 19.100 / 55. 19.100 libavcodec 57. 33.100 / 57. 33.100 libavformat 57. 29.101 / 57. 29.101 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 40.102 / 6. 40.102 libswscale 4. 1.100 / 4. 1.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 [dshow @ 000000000053a960] DirectShow video devices (some may be both video and audio devices) [dshow @ 000000000053a960] Could not enumerate video devices (or none found). [dshow @ 000000000053a960] DirectShow audio devices [dshow @ 000000000053a960] "╨Ь╨╕╨║╤А╨╛╤Д╨╛╨╜ (Realtek High Definiti" [dshow @ 000000000053a960] Alternative name "@device_cm_{33D9A762-90C8-11D0- BD43-00A0C911CE86}\╨Ь╨╕╨║╤А╨╛╤Д╨╛╨╜ (Realtek High Definiti" [dshow @ 000000000053a960] "╨б╤В╨╡╤А╨╡╨╛ ╨╝╨╕╨║╤И╨╡╤А (Realtek High Def" [dshow @ 000000000053a960] Alternative name "@device_cm_{33D9A762-90C8-11D0- BD43-00A0C911CE86}\╨б╤В╨╡╤А╨╡╨╛ ╨╝╨╕╨║╤И╨╡╤А (Realtek High Def" dummy: Immediate exit requested
Change History (11)
comment:1 by , 9 years ago
Cc: | added |
---|
comment:2 by , 9 years ago
Cc: | removed |
---|
comment:3 by , 6 years ago
I chose the font "Lucida Console" for the default console window. Sometimes this helps, but not in the case of ffmpeg.
I think you need to specify output to the console in the UTF-16 encoding.
_setmode(_fileno(stdout), _O_U16TEXT);
more info - https://stackoverflow.com/a/9051543/1988244
follow-up: 7 comment:4 by , 5 years ago
Owner: | set to |
---|---|
Status: | new → open |
Really! https://stackoverflow.com/questions/14109024/how-to-make-unicode-charset-in-cmd-exe-by-default
This is enough to solve this!
You just call cmd /K chcp 65001
But there should be a way to change it in C!
After googling here you are an implementation in curl:
https://github.com/curl/curl/pull/3212/commits
comment:5 by , 5 years ago
And here one uses SetConsoleOutputCP(65001) function.
https://github.com/curl/curl/pull/3011/files#diff-f4fa14775f0c9fa231b44d75f81dedd4R267
All of it discussed here https://dev.to/mattn/please-stop-hack-chcp-65001-27db
comment:6 by , 5 years ago
Owner: | removed |
---|
comment:7 by , 5 years ago
Thank you.
The batch file below works correctly for me.
chcp 65001 ffmpeg -list_devices true -f dshow -i dummy pause
comment:10 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | open → closed |
comment:11 by , 5 years ago
Component: | ffmpeg → avutil |
---|---|
Keywords: | win32 added |
Version: | unspecified → git-master |
Do you think it is outputting in UTF-8? hmmm I will probably just add some ability to specify device by "number" to overcome this, it is a worse problem than I thought.