0

I want to see if the String "Streamer" is inside, but it always returns false. The String isn't for sure inside the file. I think that the String is really a String. If I print the whole String some weird characters appear on top of the file.

Console Image

Console Image

// index.js

let sini = fs.readFileSync("C:\\Windows\\Sandboxie.ini", 'utf-8');
console.log(sini.includes("Streamer"))
# Sandboxie.ini

#
# Sandboxie-Plus configuration file
#

[GlobalSettings]
Template=WindowsRasMan
Template=WindowsLive
Template=OfficeLicensing
Template=OfficeClickToRun

[UserSettings_0D06021F]
SbieCtrl_UserName=tomie
SbieCtrl_NextUpdateCheck=1655566649
SbieCtrl_WindowCoords=121,311,1237,632
SbieCtrl_ActiveView=40021
SbieCtrl_ProcessViewColumnWidths=250,70,300
SbieCtrl_HideMessage=2223,Eckernfoerde.mov [Mjolnir4285177803 / 115906982]
SbieCtrl_ExplorerWarn=n
SbieCtrl_BoxExpandedView=DefaultBox

[DefaultBox]
ConfigLevel=9
AutoRecover=y
BlockNetworkFiles=y
Template=OpenSmartCard
Template=OpenBluetooth
Template=SkipHook
Template=FileCopy
Template=qWave
Template=BlockPorts
Template=LingerPrograms
Template=AutoRecoverIgnore
RecoverFolder=%{374DE290-123F-4565-9164-39C4925E467B}%
RecoverFolder=%Personal%
RecoverFolder=%Desktop%
BorderColor=#00FFFF,ttl,6
Enabled=y

[Streamer360384]
Enabled=y

[Streamer127138]
Enabled=y
Akber Iqbal
  • 14,487
  • 12
  • 48
  • 70
tomiella
  • 1
  • 2
  • 1
    Not sure if `utf8` and `utf-8` are equivalent here, but worth trying `utf8`. Assuming the file is indeed encoded that way. – jarmod Jun 15 '22 at 00:57
  • Does this answer your question? [What exactly is Unicode codepage 1200?](https://stackoverflow.com/questions/8336355/what-exactly-is-unicode-codepage-1200) – Ricky Mo Jun 15 '22 at 01:26
  • Related github issue [https://github.com/sandboxie-plus/Sandboxie/issues/197](https://github.com/sandboxie-plus/Sandboxie/issues/197), which mentions that Sandboxie.ini use Unicode codepage 01200. So try using `utf16le` – Ricky Mo Jun 15 '22 at 01:29

0 Answers0