Comments (4)
Thanks for your response, anyway :-)
I think there's no need to switch to cp850 to overcome the raster font bug of ps.
My batches always look similar like this [Example Snip]:
:_Decode
REM There's a documented powershell bug that changes font of cmd window to raster/grid font.
REM It seems to depend on the codepage setting and predefined font for cmd.exe in the registry [partic. Consolas].
REM So, run it in a separate process if cp UTF8 is selected.
REM https://github.com/microsoft/terminal/issues/367
SETLOCAL
FOR /F "tokens=2 delims=:." %%a IN ('CHCP') DO (SET /A _tmpCP=%%a)
REM This variable replaces the path in the decode section - here in :bat2file:[sed_exe - maybe left out
SET "0=%_HERE%\%~nx0"
SET _Cmd=POWERSHELL -nop -c "$f=[IO.File]::ReadAllText($env:0)-split':bat2file\:.*';iex($f[1]); X 1"
IF "%_tmpCP%"=="65001" (START /WAIT /MIN CMD /C %_CMD%) ELSE (%_cmd% >NUL)
ENDLOCAL & EXIT /B
EXIT /B
GOTO :EOF
:bat2file: Compressed2TXT v6.1
$k='.,;{-}[+](/)_|^=?O123456789ABCDeFGHyIdJKLMoN0PQRSTYUWXVZabcfghijklmnpqrstuvwxz!@#$&~E<*`%\>'; Add-Type -Ty @'
using System.IO; public class BAT91 {public static void Dec (ref string[] f, int x, string fo, string key) { unchecked {
byte[] b91=new byte[256]; int n=0,c=255,v=91,q=0,z=f[x].Length; while (c>0) b91[c--]=91; while(c<91) b91[key[c]]=(byte)c++;
using (FileStream o=new FileStream(fo,FileMode.Create)) { for (int i=0; i != z; i++) { c=b91[ f[x][i] ]; if (c == 91) continue;
if (v == 91) {v = c;} else {v += c * 91; q |= v << n; if ((v & 8191) > 88) {n += 13;} else {n += 14;} v = 91;
do {o.WriteByte((byte)q); q >>= 8; n -= 8;} while (n>7);} } if (v != 91) o.WriteByte((byte)(q | v << n)); } }}}
'@; cd -lit (Split-Path $env:0); function X([int]$x=1) {[BAT91]::Dec([ref]$f,$x+1,$x,$k); expand -R $x -F:* .; del $x -force}
:bat2file:[ sed_exe
... ... ...
from compressed2txt.
chcp 65001
is not really needed indeed
in v6.4 I've switched to 850 just to force console fonts to truetype instead of raster
there should be no impact on functionality otherwise
As for the decompression issue - that's because XP comes with a much older expand.exe tool and cab format dll's
In theory that could be updated to use the ones from 7
from compressed2txt.
It's not a full year yet since you've opened this issue. Better respond late than never, I guess ;)
from compressed2txt.
It's not just for the raster font. Some localized commands can get in a way.
from compressed2txt.
Related Issues (9)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compressed2txt.