There are various reasons that this could happen.
Share more information like what phone do you have, what language you are using and what type of phone SMS recipient has. Various phones do not recognise language of received SMS and show boxes like characters.
If you have installed any application from any unsecure site your phone might get infected with virus and/or malware. You can always download any antivirus software and scan your device there are various free antivirus apps available for smart phones. Even paid apps can scan and give you alert if there is any malware in your device. I use Avast in Android based phone, it is free and good.