Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open file when coding comment does not match actual encoding #926

Closed
zooba opened this issue Oct 22, 2015 · 0 comments
Closed

Cannot open file when coding comment does not match actual encoding #926

zooba opened this issue Oct 22, 2015 · 0 comments
Assignees
Labels
Milestone

Comments

@zooba
Copy link
Member

zooba commented Oct 22, 2015

If you create a file like:

# -*- coding: utf-8 -*-
# ©®

And save it as ANSI encoding, PTVS will raise a BadSourceException on load when it encounters the incorrectly encoded characters. This causes the file to not open.

We should handle the failure more gracefully and replace the invalid characters with ? or \uFFFD.

@zooba zooba added this to the 2.2.1 milestone Oct 22, 2015
@zooba zooba self-assigned this Oct 22, 2015
zooba added a commit to zooba/PTVS that referenced this issue Oct 23, 2015
…ch actual encoding

Makes fallback class only return correct number of substitution characters.
Changes default encoding to UTF-8 properly.
Makes GetEncodingFromStream() (only used for the editor detection) return non-throwing encodings.
@zooba zooba mentioned this issue Oct 23, 2015
@zooba zooba closed this as completed Nov 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant