bin/brew: enforce UTF-8 locale
bin/brew: enforce UTF-8 locale

Everyone should be using a UTF-8 locale nowadays. Not using one causes
issues like `brew doctor` failing while checking symbolic links that
point at file names with non-ASCII characters, since OS X always uses
Unicode for the file system.

Rely on `locale charmap` to detect the currently selected encoding and
if that's not UTF-8, override the user's choice (if any) by setting
`LC_ALL` to `en_US.UTF-8`, the assumption being that every system has a
usable `en_US.UTF-8` locale installed.

Fixes Homebrew/homebrew#44744.
Closes Homebrew/homebrew#47247.

Signed-off-by: Martin Afanasjew <54669547a225ff20cba8b75a4adca540eef25858@afanasjew.de>

gordonmcshane/homebrew,muellermartin/dist,jmsundar/brew,gregory-nisbet/brew,Homebrew/brew,jmsundar/brew,staticfloat/brew,Linuxbrew/brew,sjackman/homebrew,muellermartin/dist,EricFromCanada/brew,mahori/brew,vitorgalvao/brew,amar-laksh/brew_sudo,pseudocody/brew,mistydemeo/homebrew,mahori/brew,ilovezfs/brew,mistydemeo/homebrew,bfontaine/brew,muellermartin/dist,maxim-belkin/brew,claui/brew,DomT4/brew,sjackman/homebrew,DomT4/brew,staticfloat/brew,bfontaine/brew,alyssais/brew,ilovezfs/brew,JCount/brew,mahori/brew,claui/brew,nandub/brew,tonyg/homebrew,JCount/brew,aw1621107/brew,MikeMcQuaid/brew,vitorgalvao/brew,reitermarkus/brew,konqui/brew,EricFromCanada/brew,reitermarkus/brew,bfontaine/brew,mgrimes/brew,aw1621107/brew,palxex/brew,AnastasiaSulyagina/brew,rwhogg/brew,konqui/brew,Homebrew/brew,reelsense/brew,Linuxbrew/brew,MikeMcQuaid/brew,staticfloat/brew,konqui/brew,nandub/brew,alyssais/brew,jmsundar/brew,toonetown/homebrew,amar-laksh/brew_sudo,JCount/brew,maxim-belkin/brew,gordonmcshane/homebrew,gordonmcshane/homebrew,claui/brew,vitorgalvao/brew,rwhogg/brew,mgrimes/brew,sjackman/homebrew,palxex/brew,palxex/brew,maxim-belkin/brew,aw1621107/brew,mistydemeo/homebrew,tonyg/homebrew,nandub/brew,konqui/brew,sjackman/homebrew,zmwangx/brew,tonyg/homebrew,EricFromCanada/brew,Linuxbrew/brew,Homebrew/brew,reelsense/brew,MikeMcQuaid/brew,Homebrew/brew,amar-laksh/brew_sudo,zmwangx/brew,gregory-nisbet/brew,DomT4/brew,hanxue/linuxbrew,EricFromCanada/brew,vitorgalvao/brew,AnastasiaSulyagina/brew,alyssais/brew,nandub/brew,rwhogg/brew,claui/brew,reelsense/brew,JCount/brew,MikeMcQuaid/brew,zmwangx/brew,reitermarkus/brew,DomT4/brew,hanxue/linuxbrew,mgrimes/brew,Linuxbrew/brew,toonetown/homebrew,ilovezfs/brew,toonetown/homebrew,AnastasiaSulyagina/brew,pseudocody/brew,mahori/brew,gregory-nisbet/brew,pseudocody/brew,reitermarkus/brew,hanxue/linuxbrew