I am trying to open a .pkpass file (or merely the contained pass.json file) in an app I am developing, however, while I didn't have issues with 3 passes I tried, the 4th seems to have some kind of weird encoding and/or binary data within the JSON.
When I open the JSON file using e.g. less in the shell, I'll get this:
And while we can see mostly garbage, there is readable characters mixed into it. When I open it using XCode, this is what I get:
This leads me to believe its a character encoding issue. But I am not too good in text encoding, so I don't know how I can find out the correct encoding in order to be able to properly read this file with my app. file is giving me:
$ file -I pass.json
pass.json: application/octet-stream; charset=binary
I tried opening the file with BBedit over and over again with different encodings, none would open it in a readable format.
What kind of format is this, or how can I find out, so I can implement the correct method of opening/parsing this file?


I feel you're encondind the file
pass.jsoncharset as a binary, and this file must be a charset for text like this:Check your how you are generating the package of
.pkpassfile because maybe you are zip or compress every file inside the package instead package all the required files.Could you post more about code of how you are generating the
.pkpassfile?