radareorg / sdb

Simple and fast string based key-value database with support for arrays and json
https://www.radare.org/
MIT License
218 stars 62 forks source link

Strip UTF8 BOM when creating db #209

Closed kazarmy closed 4 years ago

kazarmy commented 4 years ago

Detailed description

This pr prevents the following:

BOM_in_sdb_with_oval

i.e. a UTF8 BOM in an sdb, due to a UTF8 BOM that materialized in sdb.exe's input.

For this particular case, I'm not entirely sure how it materialized -- current hypothesis is that a combination of PowerShell's Get-Content + https://superuser.com/questions/269818/change-default-code-page-of-windows-console-to-utf-8/1435645#1435645 is the cause.

Test plan

Travis is green.

Closing issues

...

kazarmy commented 4 years ago

Edited the description.

kazarmy commented 4 years ago

Is this affecting the very first line of every line?

No but just realized that today. Sorry.

As long as its windows fault maybe worth check if theres a way to tell windows not to bom outputs maybe

Yeah see radareorg/radare2#17203. Closing this pr.