Page 1 of 1

VS2015 UTF8 file open problems

PostPosted: May 19th, 2017, 8:01 am
by urosg
Hi,

I have been experiencing some problems lately and I can not pinpoint where the problem is.

I have PHP files which include some UTF8 characters and are all saved without BOM.

When opening such files they are opened in Win1250 codepage and after saving the UTF8 chars are then broken, this didn't occur before.

I guess the automagic detecting doesn't work because the count of the UTF8 chars is small - i.e. usually only a couple, maybe even only one per file that is couple of kB in size.

Any suggestions on how to fix this are welcome.

Kind regards,
Uros

Re: VS2015 UTF8 file open problems

PostPosted: May 22nd, 2017, 12:20 pm
by Jakub Misek
Hi,

This is handled be Visual Studio Editor itself. There is an option for UTF8 without BOM detection in Options / Text Editor (see the attachment)

The detection first tries to encode the file in UTF8, if it fails it continues with current system encoding.

I hope it helps.

Re: VS2015 UTF8 file open problems

PostPosted: May 23rd, 2017, 10:53 am
by urosg
Hi,

I have this set and also browsed around a little, usually this detection works OK, but not in this file, which is strange as I know it worked a while ago...

Also tried adding some UTF8 chars in a comment at beginning of the file but it didn't help.

If anyone has any suggestions they are very welcome!

Thanks!

Re: VS2015 UTF8 file open problems

PostPosted: May 26th, 2017, 1:45 pm
by Miloslav Beno
Hello,

Could you please try latest preview and let us know? There were some changes related to UTF8 handling.

Thank you!