1

Weird issue here not like anything else I've ever come across so hoping someone else has seen something similar and can point me in the right direction.

In my text editor (Sublime 3) I open the file in question and the code I'm having a problem with in Visual Studio looks like this:

m_TargetApplicationFaçade = new TargetApplicationFaçade

Which is how I would expect it to look, however when I open my .sln project file (sorry if my terminology is wrong - very new to Visual Studio) the same line of code appears like this:

m_TargetApplicationFa鏰de = new TargetApplicationFa鏰de

On trying to build the application Visual Studio errors at these characters - this is a working application which I have just cloned from a Git repo so I shouldn't need to go through changing anything - ie, I'd rather not replace the 'ç' letter, I'd rather figure out why Visual Studio doesn't seem to like it ... if possible!

I'm working on a Mac if that helps!

Hope that all makes sense and is enough information

Any advise welcome

Regards, Neil

Neil Kelsey
  • 811
  • 4
  • 13
  • 31
  • 1
    Works fine on VS 2013 in Windows 7. Maybe something to do with the Mac version? What version of VS is it? – rory.ap Feb 02 '17 at 12:35
  • Check you have the auto-detect utf-8 option selected? – BugFinder Feb 02 '17 at 12:35
  • 1
    ç is not a latin letter (though it depends on your definition of "latin"), and it isn't in ASCII. If you want to reliably use non-ASCII characters, make sure everything is in Unicode. Otherwise, make sure all your tools use the same encoding - it looks like the single-byte encoding you have in Git is interpreted as UTF-8 in Visual Studio (a decent assumption most of the time - and given how little information you've given the heuristics, the only reasonable assumption). – Luaan Feb 02 '17 at 12:42
  • `ç` is in extended ASCII if i'm not wrong – Pikoh Feb 02 '17 at 12:43
  • 3
    @Pikoh: "extended ASCII" is a needlessly vague term people should stop using. ç is not in ASCII; it's also not in a lot of other character sets. There are character sets that have ASCII as a proper subset and also have ç, but please don't call that "extended ASCII", since it tells you nothing about which character set (let alone encoding) is actually meant. (Latin-1? Windows-1252? HP Roman? UTF-8?) It also really doesn't matter in which character sets ç actually exists, since this is a simple issue of the editor misinterpreting the encoding. – Jeroen Mostert Feb 02 '17 at 12:47
  • 4
    What you're seeing is what you would get if the file were encoded using the Latin-1 encoding and then decoded using this encoding: https://en.m.wikipedia.org/wiki/Code_page_1386 I don't know how to get Visual Studio to recognize the encoding correctly, but if you convert the file to UTF-8, Visual Studio might be able to automatically recognize that. – Tanner Swett Feb 02 '17 at 12:48
  • 2
    Convert the source files to UTF8 and make sure the contain a byte order mark (BOM). VS will recognize them as UTF8. – Sefe Feb 02 '17 at 12:50

1 Answers1

0

Thank you Tanner Swett in the comments for figuring the answer to this one.

The problem was that the file was incorrectly encoded using Latin-1 - I changed the coding of the file to UTF-8 - I did this in Sublime 3 (a quick Google will give you the answer how to do that) then reopened my project in Visual Studio and the errors were gone! :-)

Thank you all again!

N

Neil Kelsey
  • 811
  • 4
  • 13
  • 31
  • Also note that a good standard for .NET applications is to avoid non-ASCII characters for public members. While .NET has good support for Unicode characters, it makes things trickier than they need to be (e.g. most people don't know how to type `ç` on their keyboard, and it might be confused with a different character). Just because you *can* use `Façade` as an identifier doesn't mean you *should* :) I could also use a mix of latin and Cyrillic characters that resemble latin for all my identifiers, but surely you agree that would be rather hostile :P – Luaan Feb 02 '17 at 13:11
  • Couldn't agree more Luaan - not sure why whoever made this did so but hey ho! :-) – Neil Kelsey Feb 02 '17 at 13:14