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 #44744.
Closes #47247.

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

sakra/homebrew,dongcarl/homebrew,mmizutani/homebrew,thinker0/homebrew,frodeaa/homebrew,benjaminfrank/homebrew,dunn/homebrew,cprecioso/homebrew,blogabe/homebrew,alebcay/homebrew,booi/homebrew,muellermartin/homebrew,arnested/homebrew,filcab/homebrew,sjackman/linuxbrew,drbenmorgan/linuxbrew,davydden/linuxbrew,scorphus/homebrew,skatsuta/homebrew,mkrapp/homebrew,drewwells/homebrew,skinny-framework/homebrew,ebouaziz/linuxbrew,hyuni/homebrew,jsjohnst/homebrew,blogabe/homebrew,nandub/homebrew,zchee/homebrew,quantumsteve/homebrew,gicmo/homebrew,bukzor/linuxbrew,LinusU/homebrew,josa42/homebrew,polishgeeks/homebrew,alebcay/homebrew,blogabe/homebrew,polishgeeks/homebrew,dutchcoders/homebrew,elyscape/homebrew,ralic/homebrew,thinker0/homebrew,SteveClement/homebrew,optikfluffel/homebrew,Asuranceturix/homebrew,dericed/homebrew,knpwrs/homebrew,danieroux/homebrew,AlexejK/homebrew,teslamint/homebrew,jiashuw/homebrew,hongkongkiwi/homebrew,yazuuchi/homebrew,decors/homebrew,booi/homebrew,bukzor/linuxbrew,emcrisostomo/homebrew,tutumcloud/homebrew,esamson/homebrew,totalvoidness/homebrew,dickeyxxx/homebrew,royhodgman/homebrew,nelstrom/homebrew,brunchboy/homebrew,polishgeeks/homebrew,liamstask/homebrew,scorphus/homebrew,base10/homebrew,ablyler/homebrew,jarrettmeyer/homebrew,arnested/homebrew,apjanke/homebrew,danieroux/homebrew,knpwrs/homebrew,ybott/homebrew,keith/homebrew,kodabb/homebrew,pcottle/homebrew,recruit-tech/homebrew,Linuxbrew/linuxbrew,sakra/homebrew,influxdata/homebrew,DoomHammer/linuxbrew,pdxdan/homebrew,feelpp/homebrew,jsjohnst/homebrew,kenips/homebrew,ralic/homebrew,elgertam/homebrew,Chilledheart/homebrew,frodeaa/homebrew,mkrapp/homebrew,gicmo/homebrew,optikfluffel/homebrew,nelstrom/homebrew,nelstrom/homebrew,filcab/homebrew,feelpp/homebrew,joshfriend/homebrew,liamstask/homebrew,dgageot/homebrew,josa42/homebrew,hakamadare/homebrew,zhipeng-jia/homebrew,Homebrew/homebrew,sferik/homebrew,hanxue/homebrew,OJFord/homebrew,Linuxbrew/linuxbrew,sometimesfood/homebrew,slyphon/homebrew,OJFord/homebrew,lrascao/homebrew,quantumsteve/homebrew,mobileoverlord/homebrew-1,Chilledheart/homebrew,MartinDelille/homebrew,MoSal/homebrew,georgschoelly/homebrew,reelsense/linuxbrew,ilovezfs/homebrew,Homebrew/homebrew,theeternalsw0rd/homebrew,gnubila-france/linuxbrew,galaxy001/homebrew,jamer/homebrew,princeofdarkness76/homebrew,OJFord/homebrew,hyuni/homebrew,yazuuchi/homebrew,getgauge/homebrew,Angeldude/linuxbrew,booi/homebrew,cscetbon/homebrew,dericed/homebrew,LinusU/homebrew,princeofdarkness76/homebrew,knpwrs/homebrew,drewwells/homebrew,kevinastone/homebrew,sometimesfood/homebrew,ablyler/homebrew,influxdata/homebrew,miketheman/homebrew,kenips/homebrew,apjanke/homebrew,adamliter/homebrew,iostat/homebrew2,joshfriend/homebrew,Homebrew/linuxbrew,keith/homebrew,ento/homebrew,hanxue/homebrew,SuperNEMO-DBD/cadfaelbrew,zhipeng-jia/homebrew,teslamint/homebrew,skatsuta/homebrew,utzig/homebrew,cprecioso/homebrew,ear/homebrew,Asuranceturix/homebrew,vigo/homebrew,dutchcoders/homebrew,hongkongkiwi/homebrew,treyharris/homebrew,sometimesfood/homebrew,cprecioso/homebrew,lrascao/homebrew,liamstask/homebrew,elyscape/homebrew,drbenmorgan/linuxbrew,chadcatlett/homebrew,zchee/homebrew,retrography/homebrew,jconley/homebrew,davydden/linuxbrew,quantumsteve/homebrew,afh/homebrew,scpeters/homebrew,base10/homebrew,AlexejK/homebrew,haihappen/homebrew,BrewTestBot/homebrew,pdxdan/homebrew,LinusU/homebrew,eighthave/homebrew,ebouaziz/linuxbrew,dunn/homebrew,kevinastone/homebrew,SteveClement/homebrew,MartinDelille/homebrew,jsjohnst/homebrew,brunchboy/homebrew,Asuranceturix/homebrew,adamliter/homebrew,cscetbon/homebrew,esamson/homebrew,royhodgman/homebrew,SteveClement/homebrew,johanhammar/homebrew,osimola/homebrew,apjanke/homebrew,reelsense/homebrew,Homebrew/linuxbrew,benjaminfrank/homebrew,youtux/homebrew,jarrettmeyer/homebrew,Chilledheart/homebrew,recruit-tech/homebrew,optikfluffel/homebrew,SuperNEMO-DBD/cadfaelbrew,bukzor/linuxbrew,retrography/homebrew,mactkg/homebrew,Chilledheart/homebrew,dericed/homebrew,princeofdarkness76/homebrew,decors/homebrew,tutumcloud/homebrew,dunn/homebrew,apjanke/homebrew,Angeldude/linuxbrew,ybott/homebrew,nelstrom/homebrew,kenips/homebrew,totalvoidness/homebrew,base10/homebrew,influxdb/homebrew,afh/homebrew,ilovezfs/homebrew,arnested/homebrew,elyscape/homebrew,dgageot/homebrew,optikfluffel/homebrew,MoSal/homebrew,gnubila-france/linuxbrew,elgertam/homebrew,jarrettmeyer/homebrew,ento/homebrew,menivaitsi/homebrew,dgageot/homebrew,knpwrs/homebrew,ebouaziz/linuxbrew,saketkc/linuxbrew,drewwells/homebrew,lrascao/homebrew,sakra/homebrew,reelsense/linuxbrew,tschoonj/homebrew,dutchcoders/homebrew,ralic/homebrew,treyharris/homebrew,sferik/homebrew,bigbes/homebrew,keith/homebrew,AlexejK/homebrew,georgschoelly/homebrew,reelsense/linuxbrew,dplarson/homebrew,elgertam/homebrew,hanxue/homebrew,drbenmorgan/linuxbrew,arnested/homebrew,jconley/homebrew,adamliter/homebrew,gawbul/homebrew,ear/homebrew,cscetbon/homebrew,cosmo0920/homebrew,dongcarl/homebrew,getgauge/homebrew,jab/homebrew,jarrettmeyer/homebrew,miketheman/homebrew,slyphon/homebrew,mactkg/homebrew,dalanmiller/homebrew,gnubila-france/linuxbrew,dalanmiller/homebrew,nandub/homebrew,scorphus/homebrew,sferik/homebrew,georgschoelly/homebrew,filcab/homebrew,iandennismiller/homebrew,theeternalsw0rd/homebrew,recruit-tech/homebrew,ilovezfs/homebrew,decors/homebrew,hongkongkiwi/homebrew,eighthave/homebrew,ryanfb/homebrew,influxdata/homebrew,hyuni/homebrew,TaylorMonacelli/homebrew,jconley/homebrew,haihappen/homebrew,chadcatlett/homebrew,cprecioso/homebrew,mobileoverlord/homebrew-1,dalanmiller/homebrew,emcrisostomo/homebrew,MoSal/homebrew,iandennismiller/homebrew,getgauge/homebrew,kevinastone/homebrew,ExtremeMan/homebrew,drewwells/homebrew,polishgeeks/homebrew,Red54/homebrew,skinny-framework/homebrew,ablyler/homebrew,influxdb/homebrew,LinusU/homebrew,redpen-cc/homebrew,utzig/homebrew,DoomHammer/linuxbrew,ybott/homebrew,kenips/homebrew,bigbes/homebrew,menivaitsi/homebrew,dunn/homebrew,iostat/homebrew2,scpeters/homebrew,yazuuchi/homebrew,BrewTestBot/homebrew,SteveClement/homebrew,afh/homebrew,scpeters/homebrew,gawbul/homebrew,ryanfb/homebrew,theeternalsw0rd/homebrew,SuperNEMO-DBD/cadfaelbrew,iandennismiller/homebrew,georgschoelly/homebrew,menivaitsi/homebrew,pcottle/homebrew,reelsense/linuxbrew,jamer/homebrew,TaylorMonacelli/homebrew,cosmo0920/homebrew,danieroux/homebrew,iandennismiller/homebrew,jiashuw/homebrew,hakamadare/homebrew,osimola/homebrew,muellermartin/homebrew,ablyler/homebrew,Homebrew/homebrew,SuperNEMO-DBD/cadfaelbrew,esamson/homebrew,reelsense/homebrew,cosmo0920/homebrew,osimola/homebrew,slyphon/homebrew,muellermartin/homebrew,TaylorMonacelli/homebrew,utzig/homebrew,pcottle/homebrew,redpen-cc/homebrew,jamer/homebrew,3van/homebrew,marcwebbie/homebrew,totalvoidness/homebrew,ryanfb/homebrew,deorth/homebrew,kodabb/homebrew,zchee/homebrew,royhodgman/homebrew,Homebrew/linuxbrew,johanhammar/homebrew,jconley/homebrew,quantumsteve/homebrew,Red54/homebrew,3van/homebrew,yumitsu/homebrew,base10/homebrew,zhipeng-jia/homebrew,utzig/homebrew,gicmo/homebrew,dutchcoders/homebrew,teslamint/homebrew,miketheman/homebrew,sometimesfood/homebrew,mactkg/homebrew,youtux/homebrew,Angeldude/linuxbrew,bigbes/homebrew,pdxdan/homebrew,sjackman/linuxbrew,treyharris/homebrew,alebcay/homebrew,DoomHammer/linuxbrew,scorphus/homebrew,3van/homebrew,johanhammar/homebrew,treyharris/homebrew,hanxue/homebrew,BrewTestBot/homebrew,vigo/homebrew,chadcatlett/homebrew,dickeyxxx/homebrew,princeofdarkness76/homebrew,thinker0/homebrew,ryanfb/homebrew,deorth/homebrew,influxdata/homebrew,ralic/homebrew,skinny-framework/homebrew,skatsuta/homebrew,pcottle/homebrew,Red54/homebrew,ento/homebrew,Homebrew/linuxbrew,emcrisostomo/homebrew,marcwebbie/homebrew,elgertam/homebrew,galaxy001/homebrew,Linuxbrew/linuxbrew,mkrapp/homebrew,dplarson/homebrew,adamliter/homebrew,kodabb/homebrew,tutumcloud/homebrew,jiashuw/homebrew,zhipeng-jia/homebrew,michaKFromParis/homebrew-sparks,gicmo/homebrew,bigbes/homebrew,influxdb/homebrew,tschoonj/homebrew,yumitsu/homebrew,yazuuchi/homebrew,zchee/homebrew,manphiz/homebrew,saketkc/linuxbrew,dericed/homebrew,haihappen/homebrew,saketkc/linuxbrew,hyuni/homebrew,davydden/linuxbrew,ento/homebrew,emcrisostomo/homebrew,dplarson/homebrew,tschoonj/homebrew,frodeaa/homebrew,Asuranceturix/homebrew,Homebrew/homebrew,dgageot/homebrew,mmizutani/homebrew,MartinDelille/homebrew,ear/homebrew,getgauge/homebrew,benjaminfrank/homebrew,benjaminfrank/homebrew,eighthave/homebrew,totalvoidness/homebrew,manphiz/homebrew,reelsense/homebrew,mmizutani/homebrew,jamer/homebrew,brunchboy/homebrew,retrography/homebrew,osimola/homebrew,ExtremeMan/homebrew,Asuranceturix/homebrew,johanhammar/homebrew,jab/homebrew,blogabe/homebrew,haihappen/homebrew,michaKFromParis/homebrew-sparks,bukzor/linuxbrew,keith/homebrew,michaKFromParis/homebrew-sparks,skatsuta/homebrew,deorth/homebrew,kodabb/homebrew,dongcarl/homebrew,dickeyxxx/homebrew,mobileoverlord/homebrew-1,brunchboy/homebrew,youtux/homebrew,hakamadare/homebrew,elyscape/homebrew,Angeldude/linuxbrew,ExtremeMan/homebrew,marcwebbie/homebrew,davydden/linuxbrew,filcab/homebrew,3van/homebrew,yumitsu/homebrew,iostat/homebrew2,retrography/homebrew,muellermartin/homebrew,jab/homebrew,mobileoverlord/homebrew-1,teslamint/homebrew,jsjohnst/homebrew,nandub/homebrew,ilovezfs/homebrew,esamson/homebrew,galaxy001/homebrew,youtux/homebrew,manphiz/homebrew,theeternalsw0rd/homebrew,mmizutani/homebrew,danieroux/homebrew,redpen-cc/homebrew,ExtremeMan/homebrew,ebouaziz/linuxbrew,josa42/homebrew,miketheman/homebrew,redpen-cc/homebrew,reelsense/homebrew,sakra/homebrew,ybott/homebrew,SteveClement/homebrew,hakamadare/homebrew,pdxdan/homebrew,BrewTestBot/homebrew,vigo/homebrew,dongcarl/homebrew,recruit-tech/homebrew,saketkc/linuxbrew,ear/homebrew,gawbul/homebrew,mactkg/homebrew,Red54/homebrew,tschoonj/homebrew,liamstask/homebrew,feelpp/homebrew,influxdb/homebrew,royhodgman/homebrew,alebcay/homebrew,MartinDelille/homebrew,marcwebbie/homebrew,galaxy001/homebrew,pcottle/homebrew,Linuxbrew/linuxbrew,manphiz/homebrew,iostat/homebrew2,feelpp/homebrew,drbenmorgan/linuxbrew,slyphon/homebrew,tutumcloud/homebrew,OJFord/homebrew,skinny-framework/homebrew,hongkongkiwi/homebrew,joshfriend/homebrew,dplarson/homebrew,jiashuw/homebrew,kevinastone/homebrew,sferik/homebrew,MoSal/homebrew,sjackman/linuxbrew,frodeaa/homebrew,nandub/homebrew,menivaitsi/homebrew,vigo/homebrew,scpeters/homebrew,dickeyxxx/homebrew,thinker0/homebrew,cosmo0920/homebrew,sjackman/linuxbrew,decors/homebrew,dalanmiller/homebrew,afh/homebrew,AlexejK/homebrew,gnubila-france/linuxbrew,DoomHammer/linuxbrew,TaylorMonacelli/homebrew,jab/homebrew,eighthave/homebrew