Rules file corrupt

Dear all,
I (think) I do have an issue:
I just wanted to do some rule adjustments and found this:

(extract of the rules file)

var int woziUp=0 //track if shutters wozi should go up or down
var int dayClean=0 //trqCk if  rq� during the day
var iNt woziAzimuthGnd = 279
var int wozmAzimuthStirt = 110
var float deltaTemp0=0
var int deltaTriggerTemp01 = 10
var int

So my complete rules file seems to be corrup with those odd characters.
OH 1.8.3 is running and I do not see any issues.
Unfortunately I do not have a backup of the rules file. all others seem to be ok.
I am concerned that it will not start when I stop it.

Did anyone experience something like this before?
I guess this happend when I last saved it. I always use the openhab designer.

also looking with vi into the file, same odd characters.

Any chance I can get this restored without rewriting?

Thanks
SJ

At least take a copy now before it gets worse!

What kind of host system are you running on?

thank you. I do have made a copy and I have a backup from a few months ago. A lot has changed.
I am running OH on a RasPi3 with Jessie.
I guess it is the SD card - however everything else seems ok.

What encryption would be normal for the rules file on a RPi Jessie system?
Just checked and it says binary. The older backup it utf-8
Wonder how that happened…
Until now, wasn’t able to convert it back

Any ideas?

If you’re using Windows you try notepad++. With notepad++ you can easyly convert to any encoding you need. For your installation you need “UTF8 without BOM”

Thank you. Either npp wasn’t able to convert or I didn’t set the right flags…
Anyhow, I corrected it manually. Basically had to rewrite the file. Only took me a night :wink:
But I am still wondering what have caused it. Is there a possibility that during saving it got corrupted? Otherwise I would need to exchange my SD card as it usually gets worse over time.