Reporter | bkmz (bkmz123) |
---|---|
Created | Mar 24, 2012 3:35:49 PM |
Updated | Mar 24, 2012 3:41:57 PM |
Priority | Normal |
Type | Task |
Fix versions | No Fix versions |
State | Submitted |
Assignee | Sergey Shkredov (serjic.shkredov) |
Subsystem | Refactoring |
Affected versions | 6.1.1 |
Fixed in build | No Fixed in build |
Problem
- Using VS, developers could be expected to write non-english text (comments, literals, etc)
- Given such text is russian, one could save file in cp1251 or in unicode encodings
- Nowadays it's a standard for everyone to keep it's files as unicode saved
- Using ReSharpers commands that generate new files ('Move to another file to math type name', for examaple) one get's new files saved ALWAYS in cp1251, that leads to:
- unread characters on popular resources such as github
- resaving files by frustrated developers
- unread characters on popular resources such as github
Steps to reproduce
- Open blank VS and do whatever to make VS to work with Unicode files by default:
- Set Tools->Environment->Documents : Save documents as Unicode when data cannot be saved in codepage.
- Set Tools->Text Editor->General->Auto-detect UTF-8 encoding without signature
- Set Tools->Environment->Documents : Save documents as Unicode when data cannot be saved in codepage.
- Create plain Console application.
- Given Program.cs as default application entry file, ensure it's saved in Unicode: File->Save Program.cs as->Save with encoding->*see encoding* (Alternatively, one could quickly check encoding via loading file in browser).
- Create new class via VS generation methods: type ClassFromWs classFromWs = new ClassFromWS(); and use Visual studio quick fix to create new file 'Generate class for ClassFromWs'. Ensure it is saved in Unicode.
- Create new file for new class via RS methods: Type ClassFromRS classFromRs = new ClassFromRs(); and use ReSharper commands - 'Create class ClassFromRs'. Generated class appears in Program.cs. Use 'Move to another...' on ClassFromRs to move it to new file. See it's saved in cp1251.
- Alternatively, create a new class but use SolutionExplorer->Refactor->Move types into matching files on Program.cs. New class appears in solution explorer, but is saved in cp1251.
- Given Program.cs as default application entry file, ensure it's saved in Unicode: File->Save Program.cs as->Save with encoding->*see encoding* (Alternatively, one could quickly check encoding via loading file in browser).
Expected behaviour
I'd expect Unicode to be default encoding on every new RS-generated file, but I presume more correct expected behaviour will be:
"Both ways 2.C and 2.D should generate files with encodings that are equal to one in which VS saves it's new files."