Drupal cron will unserialize array and add extra characters I am working in an application using Drupal. Thru the UI I upload a text file that is then parse and each line store in the DB as a serialized array. So far so good until there. 

I have setup a module using queue and the hook_cron that will check each of the serialize arrays from the DB and make a node out of it.

I was getting some odd errors like the cron was not able to parse the serialized array and I noticed something odd the array keys were been serialize with extra characters (invisible characters).

While looking in the DB imports I notice that something like the word "comunique" that when serialize should be like:

s:9:"comunique"


instead it was showing like:

s:12:"comunique"


also a print_r show me the following:

[comunique ‎] =&gt; Array (...)


I even test changing the word and there are always 3 characters extra. I tested locally in my computer and it is all good.

What am I missing? is this a server config issue or a code issue?
Thank you for your input. I open the PHP file with Notepad++ and there was the hidden tilde character. I remove it an everything started to work again like a charm.

For people having a similar issue, I will recommend opening the file in a different text editor.