Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic [bug?] error: stray '\357' in program (Read 16302 times)
nevereven
Junior Member
**
Offline


Posts: 59
Joined: Dec 5th, 2014
[bug?] error: stray '\357' in program
Jan 12th, 2015 at 2:46pm
Print Post  
I'm running the latest beta of Visual Studio (1.1412.10). It may be my ignorance of the setup, but whenever I do:

File->New->File
CPP File
[edit file...]
Save as...
F7

I get:

filename.cpp:1: error: stray '\357' in program
filename.cpp:1: error: stray '\273' in program
filename.cpp:1: error: stray '\277' in program

Which I believe is a Unicode byte order mark.

My fix is to open the file in notepad++ and change the encoding to "ANSI or "UTF-8 without BOM"
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12189
Location: United Kingdom
Joined: Apr 10th, 2010
Re: [bug?] error: stray '\357' in program
Reply #1 - Jan 12th, 2015 at 2:59pm
Print Post  
Hi,

I am not sure why you are seeing some unicode chars in the file. You can also save with a different encoding in atmel studio with the "save as". In visual studio it should automatically warn you that you have unicode chars in your file and ask you if you want to switch to a different encoding.

The "new cpp file" option is part of the ide and not visual micro, so maybe it puts your name in the comments at the top which contains unicode?

Thanks
  
Back to top
IP Logged
 
nevereven
Junior Member
**
Offline


Posts: 59
Joined: Dec 5th, 2014
Re: [bug?] error: stray '\357' in program
Reply #2 - Jan 14th, 2015 at 5:12pm
Print Post  
THe solution seems to be:
File->Advanced Save Options
Change encoding to US-ASCII - Codepage 20127
I think Unicode (UTF-8 without signature) - Codepage 65001 might work as well.

Still seems strange that it would save file as UTF-8 then choke on it when compiling.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12189
Location: United Kingdom
Joined: Apr 10th, 2010
Re: [bug?] error: stray '\357' in program
Reply #3 - Jan 14th, 2015 at 5:18pm
Print Post  
Hi,

You used the generic visual studio feature to create a cpp file but arduino doesn't support all the features that some programs support. Vs attempts to be clever so if your name contains unicode then it will create a utf8 instead of ascii file.

Best to right click the project in the solution explorer and use the visual micro functions on the "Add" menu. The visual micro functions will create a .cpp and .h in the simpler format for you.
« Last Edit: Jan 14th, 2015 at 5:19pm by Tim@Visual Micro »  
Back to top
IP Logged
 
nevereven
Junior Member
**
Offline


Posts: 59
Joined: Dec 5th, 2014
Re: [bug?] error: stray '\357' in program
Reply #4 - Jan 14th, 2015 at 5:27pm
Print Post  
Thanks, I wasn't aware of that option.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint