Fix Console Encoding test (#14862)
Fix Console Encoding test (#14862)

The test needed to handle the case when having encoding enabled to produce preamble bytes BOM (e.g. UTF8)
calling Encoding.GetBytes doesn’t include the BOM while the console stream will include it.
The fix is just handling the BOM when we'll have it.
richlander/corefx,seanshpark/corefx,fgreinacher/corefx,weltkante/corefx,rubo/corefx,Ermiar/corefx,Petermarcu/corefx,mazong1123/corefx,gkhanna79/corefx,krytarowski/corefx,nchikanov/corefx,dotnet-bot/corefx,BrennanConroy/corefx,axelheer/corefx,twsouthwick/corefx,Petermarcu/corefx,dhoehna/corefx,DnlHarvey/corefx,lggomez/corefx,JosephTremoulet/corefx,twsouthwick/corefx,rjxby/corefx,ptoonen/corefx,tijoytom/corefx,richlander/corefx,rubo/corefx,alexperovich/corefx,ptoonen/corefx,axelheer/corefx,JosephTremoulet/corefx,parjong/corefx,yizhang82/corefx,lggomez/corefx,DnlHarvey/corefx,krk/corefx,dhoehna/corefx,Ermiar/corefx,MaggieTsang/corefx,billwert/corefx,YoupHulsebos/corefx,rubo/corefx,Jiayili1/corefx,rjxby/corefx,stone-li/corefx,mmitche/corefx,stephenmichaelf/corefx,mazong1123/corefx,ptoonen/corefx,rahku/corefx,elijah6/corefx,YoupHulsebos/corefx,elijah6/corefx,the-dwyer/corefx,mmitche/corefx,marksmeltzer/corefx,rjxby/corefx,the-dwyer/corefx,ViktorHofer/corefx,gkhanna79/corefx,YoupHulsebos/corefx,jlin177/corefx,Jiayili1/corefx,ericstj/corefx,elijah6/corefx,ericstj/corefx,YoupHulsebos/corefx,mazong1123/corefx,mmitche/corefx,ericstj/corefx,weltkante/corefx,axelheer/corefx,marksmeltzer/corefx,krk/corefx,zhenlan/corefx,JosephTremoulet/corefx,Jiayili1/corefx,ViktorHofer/corefx,twsouthwick/corefx,BrennanConroy/corefx,zhenlan/corefx,stone-li/corefx,richlander/corefx,axelheer/corefx,rahku/corefx,ericstj/corefx,nchikanov/corefx,mmitche/corefx,seanshpark/corefx,yizhang82/corefx,dotnet-bot/corefx,marksmeltzer/corefx,JosephTremoulet/corefx,MaggieTsang/corefx,krk/corefx,alexperovich/corefx,dotnet-bot/corefx,stone-li/corefx,krk/corefx,billwert/corefx,rjxby/corefx,gkhanna79/corefx,rahku/corefx,ericstj/corefx,lggomez/corefx,weltkante/corefx,Jiayili1/corefx,twsouthwick/corefx,stephenmichaelf/corefx,Ermiar/corefx,ravimeda/corefx,ravimeda/corefx,richlander/corefx,wtgodbe/corefx,JosephTremoulet/corefx,jlin177/corefx,ptoonen/corefx,mazong1123/corefx,stone-li/corefx,jlin177/corefx,MaggieTsang/corefx,parjong/corefx,YoupHulsebos/corefx,dhoehna/corefx,alexperovich/corefx,the-dwyer/corefx,nchikanov/corefx,MaggieTsang/corefx,rjxby/corefx,DnlHarvey/corefx,seanshpark/corefx,shimingsg/corefx,tijoytom/corefx,stone-li/corefx,marksmeltzer/corefx,Ermiar/corefx,alexperovich/corefx,elijah6/corefx,fgreinacher/corefx,marksmeltzer/corefx,ericstj/corefx,gkhanna79/corefx,billwert/corefx,parjong/corefx,stone-li/corefx,gkhanna79/corefx,axelheer/corefx,dhoehna/corefx,gkhanna79/corefx,Ermiar/corefx,yizhang82/corefx,dotnet-bot/corefx,wtgodbe/corefx,Petermarcu/corefx,lggomez/corefx,rahku/corefx,krk/corefx,cydhaselton/corefx,wtgodbe/corefx,ViktorHofer/corefx,yizhang82/corefx,gkhanna79/corefx,Ermiar/corefx,the-dwyer/corefx,weltkante/corefx,shimingsg/corefx,twsouthwick/corefx,weltkante/corefx,Petermarcu/corefx,tijoytom/corefx,zhenlan/corefx,twsouthwick/corefx,cydhaselton/corefx,yizhang82/corefx,wtgodbe/corefx,ViktorHofer/corefx,stone-li/corefx,weltkante/corefx,stephenmichaelf/corefx,shimingsg/corefx,rubo/corefx,rjxby/corefx,tijoytom/corefx,cydhaselton/corefx,billwert/corefx,MaggieTsang/corefx,rahku/corefx,ptoonen/corefx,dotnet-bot/corefx,parjong/corefx,YoupHulsebos/corefx,ravimeda/corefx,cydhaselton/corefx,the-dwyer/corefx,MaggieTsang/corefx,Ermiar/corefx,wtgodbe/corefx,BrennanConroy/corefx,zhenlan/corefx,alexperovich/corefx,seanshpark/corefx,dhoehna/corefx,Petermarcu/corefx,ptoonen/corefx,tijoytom/corefx,DnlHarvey/corefx,nchikanov/corefx,mazong1123/corefx,seanshpark/corefx,DnlHarvey/corefx,ViktorHofer/corefx,krk/corefx,wtgodbe/corefx,shimingsg/corefx,the-dwyer/corefx,ravimeda/corefx,ravimeda/corefx,krytarowski/corefx,zhenlan/corefx,mmitche/corefx,nchikanov/corefx,zhenlan/corefx,elijah6/corefx,marksmeltzer/corefx,dhoehna/corefx,richlander/corefx,Jiayili1/corefx,nchikanov/corefx,ravimeda/corefx,jlin177/corefx,lggomez/corefx,shimingsg/corefx,nbarbettini/corefx,alexperovich/corefx,mazong1123/corefx,weltkante/corefx,DnlHarvey/corefx,stephenmichaelf/corefx,parjong/corefx,billwert/corefx,cydhaselton/corefx,ravimeda/corefx,tijoytom/corefx,Petermarcu/corefx,parjong/corefx,dotnet-bot/corefx,rjxby/corefx,krytarowski/corefx,yizhang82/corefx,nbarbettini/corefx,billwert/corefx,stephenmichaelf/corefx,dotnet-bot/corefx,JosephTremoulet/corefx,mmitche/corefx,ViktorHofer/corefx,mazong1123/corefx,seanshpark/corefx,mmitche/corefx,richlander/corefx,dhoehna/corefx,parjong/corefx,billwert/corefx,wtgodbe/corefx,stephenmichaelf/corefx,the-dwyer/corefx,twsouthwick/corefx,nbarbettini/corefx,ericstj/corefx,krytarowski/corefx,ViktorHofer/corefx,seanshpark/corefx,nbarbettini/corefx,yizhang82/corefx,Petermarcu/corefx,Jiayili1/corefx,jlin177/corefx,elijah6/corefx,cydhaselton/corefx,nbarbettini/corefx,jlin177/corefx,stephenmichaelf/corefx,krytarowski/corefx,krytarowski/corefx,JosephTremoulet/corefx,alexperovich/corefx,fgreinacher/corefx,tijoytom/corefx,fgreinacher/corefx,nchikanov/corefx,richlander/corefx,rubo/corefx,MaggieTsang/corefx,Jiayili1/corefx,elijah6/corefx,cydhaselton/corefx,krytarowski/corefx,axelheer/corefx,jlin177/corefx,krk/corefx,rahku/corefx,marksmeltzer/corefx,shimingsg/corefx,DnlHarvey/corefx,lggomez/corefx,YoupHulsebos/corefx,shimingsg/corefx,nbarbettini/corefx,zhenlan/corefx,nbarbettini/corefx,rahku/corefx,ptoonen/corefx,lggomez/corefx