[FFmpeg-devel] [PATCH v11 1/6] libavutil/wchar_filename.h: Add whcartoutf8, wchartoansi and utf8toansi

Stephen Hutchinson qyot27 at gmail.com
Mon Apr 25 23:51:29 EEST 2022


Thus far I've avoided jumping into this because I genuinely do not care
about Windows' code page shenanigans or what-all, but because this seems
to be zeroing in on one thing in particular...

On 4/25/22 5:03 AM, nil-admirari at mailo.com wrote:
> If you were to look at the code, you would've seen that charset conversion
> was already there. AviSynth is not Unicode-aware, it expects ANSI strings.
> Inline charset conversion was replaced by a library call, which, again,
> was already there, only slightly extended.
> 

 > Which is necessary for compatibility with AviSynth,

It has nothing to do with compatibility with AviSynth, because
AviSynth just uses the code page the system is set on.
What 'it's not Unicode-aware' means is that it doesn't
jump into convoluted conversions to UTF-16, because that's
what Windows meant by 'Unicode' for 20+ years,
and nobody from either classic AviSynth or Plus wanted to
do that, because it's an absolute mess and now that Plus
is cross-platform, utterly pointless on every other OS,
because they all use UTF-8 and have for at least 15 years,
if not [much] longer.

Some third-party applications that utilize AviSynth have
decided they want to bend over backwards to make sure their users
don't have to freak themselves out by telling Windows to use UTF-8 as 
the system code page, so they'll do an end-run around it and use
these sorts of manifests to force the program's locale to UTF-8,
AppLocale style. But that's not a compatibility issue
with AviSynth.  As soon as Microsoft actually makes UTF-8
the default code page going forward, that issue will poof
out of existence, as if by magic. It already does if you
toggle it on in the system settings.

Nothing special was required regarding locale support when
Linux, macOS, BSD, and Haiku support landed.  All of those use
UTF-8 and AviSynth+ works with it transparently.  And it works
with UTF-8 on Windows transparently if you've gone into the Region
Settings and actually enabled it.  Even AviSynth 2.6 is cool
with it, as this screenshot from *two years ago* illustrates:

https://i.imgur.com/1p5osrE.jpg


More information about the ffmpeg-devel mailing list