Hi! Try these steps on how to unlock your country code of you Samsung S4. I hope this will help.
1. Remove the SIM card and replace it with preferred carrier or SIM.
2. Turn off the device then turn it on again.
3. Go to the phone's dial pad and type the following: *#197328640#.
4. Go back to the menu and access UMTS.
5. Click on Debug Screen > Phone Control and Network Lock.
6. Proceed with Options > Perso SHA256 OFF.
7. Wait for a couple of minutes before going back to the main menu.
8. Wait for the message 'Network Lock' then choose NW Lock NV Data INITIALLIZ.
Given the user provided the right sequence, it should read: Asterisk Pound One Nine Seven Three Two Eight Six Four Zero Pound. It is important for users to understand that some refer to the asterisk as the "star" while others refer to the pound as the "hash."
This should unlock the phone and give the user freedom to use it. The code has been available for quite some time now. Other Samsung users may find it useful.