Encoding in VS2015
6 posts
• Page 1 of 1
Encoding in VS2015
Hi!
I have problem with file encoding in Visual studio 2015.
All my files are saved with UTF-8 without BOM.
But PHP editor opens them in windows-1250 (encoding for my country).
How can I force editor to open all files with UTF-8? Is there any settings?
I have problem with file encoding in Visual studio 2015.
All my files are saved with UTF-8 without BOM.
But PHP editor opens them in windows-1250 (encoding for my country).
How can I force editor to open all files with UTF-8? Is there any settings?
- Makla
- Posts: 4
- Joined: January 18th, 2015, 11:27 am
Re: Encoding in VS2015
Hello,
Thank you for your post.
Visual Studio editor has option for detecting UTF-8 without signature. If there is some UTF-8 character present VS will recognize that and open the file in UTF8, if not it will use default OS encoding.
PHP Tools has other options regarding UTF-8. You can:
- Force UTF-8 without signature for all the document which will be opened.
- Remove signature if it's present
- Keep current encoding of the document (default)
Give me know this information helped.
Thanks,
Thank you for your post.
Visual Studio editor has option for detecting UTF-8 without signature. If there is some UTF-8 character present VS will recognize that and open the file in UTF8, if not it will use default OS encoding.
PHP Tools has other options regarding UTF-8. You can:
- Force UTF-8 without signature for all the document which will be opened.
- Remove signature if it's present
- Keep current encoding of the document (default)
Give me know this information helped.
Thanks,
You do not have the required permissions to view the files attached to this post.
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbeno │ miloslav@devsense.com
-
Miloslav Beno - Posts: 1252
- Joined: January 7th, 2012, 8:36 pm
Re: Encoding in VS2015
It looks like your first idea solved my problem.
Thanks a lot. I change to VS 2015 and almost lost my mind.
Thanks a lot. I change to VS 2015 and almost lost my mind.
- Makla
- Posts: 4
- Joined: January 18th, 2015, 11:27 am
Re: Encoding in VS2015
This is a harsh for everyone and PHP Tools should make it easy.
You simply cannot have files with BOM used as PHP scripts, and using special characters in ANSI encoded files (which seems to be some sort of default) will yield encoding issues (so you need to convert them to UTF8 without BOM).
Maybe PHP Tools can check both conditions when saving a PHP File and if any of them are broken, prompt the user to fix the encoding issue.
Or PHP Tools can report this situation as some sort of error and tell the user which files will sure lead to encoding problems.
I cannot browse file-by-file all PHP scripts to check encoding and contents
You simply cannot have files with BOM used as PHP scripts, and using special characters in ANSI encoded files (which seems to be some sort of default) will yield encoding issues (so you need to convert them to UTF8 without BOM).
Maybe PHP Tools can check both conditions when saving a PHP File and if any of them are broken, prompt the user to fix the encoding issue.
Or PHP Tools can report this situation as some sort of error and tell the user which files will sure lead to encoding problems.
I cannot browse file-by-file all PHP scripts to check encoding and contents
- davidbcn
- Posts: 87
- Joined: September 10th, 2014, 3:07 am
Re: Encoding in VS2015
I create a new php file and it in windows-1251.
How to make sure that the file was created in the utf 8?
How to make sure that the file was created in the utf 8?
- kurshinov
- Posts: 3
- Joined: February 11th, 2016, 7:02 am
Re: Encoding in VS2015
Hello,
You can force saving the file in UTF8 without BOM by setting the option from PHP Tools which is explained here http://support.devsense.com/posting.php?mode=reply&f=21&t=1620#pr7423
Thanks,
You can force saving the file in UTF8 without BOM by setting the option from PHP Tools which is explained here http://support.devsense.com/posting.php?mode=reply&f=21&t=1620#pr7423
Thanks,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbeno │ miloslav@devsense.com
-
Miloslav Beno - Posts: 1252
- Joined: January 7th, 2012, 8:36 pm
6 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 108 guests