Hello,
when compiling sometimes I get the error above. I sense that it has to do with some character endcoding. It looks like it happens when I copy code I got via email into my source.
Any idea?
Cheers,
J.
Printable View
Hello,
when compiling sometimes I get the error above. I sense that it has to do with some character endcoding. It looks like it happens when I copy code I got via email into my source.
Any idea?
Cheers,
J.
How about showing us the code.
It's the code someone else posted to a different question. I've copy and pasted it into an email, emailed that email to another computer and copy and pasted it back.
#include<string>
#include<iostream>
#include<algorithm>
using namespace std;
char ChangeChar(char c)
{
if (c=='z' || c=='Z')
return c-=25;
else
return ++c;
}
int main()
{
string mystring("HelloZ");
cout << mystring << endl;
std::transform(mystring.begin(), mystring.end(),mystring.begin(),ChangeChar);
cout << mystring << endl;
return 0;
}
Try the code in attached file, I have copied it into ANSI format.
No problem that one works fine.
I have copied the original code into an email on MS Outlook and copied the source from Linux kmail into kate to save the source file and compile it.
Your file I have donwloaded from linux directly.
Cool ! :wave:Quote:
Originally Posted by joebar
yes cool, but what does it mean?
have a look on this
http://lists.samba.org/archive/distc...q2/003396.html
The link doesn't help me - sorry.
I acutally see the same source code in my text editor, what can I change in form of transmission to avoid that problem?
I have to do it via email I can't set up any network route or whatsoever.
Thanks.
J.
I thought you said it works fine.Quote:
Originally Posted by joebar
Who is your email provider? Contact them regarding the problem with proper steps to reproduce (STR).Quote:
Originally Posted by joebar
Well, posting the STR here wouldn't harm either. I don't exactly understand your problem. Which email client are you using?
Steps to reproduce:
1. Copy and Paste coding from codeguru.com into Outlook 2003 email on Win XP
2. Copy and Paste the coding received via email (kmail) into kate on Suse Linux 10.0.
3. Save kate file as any name
4. g++ -Wall file.cpp
Sorry don't get me wrong but, No way to contact my email provider, the text is there in my email. I can read the text so why would my email provider "waste" his time? Do you know any email provider who would spend time on this?
I only assume that it is due to character encoding, I can't think of anything else, but who knows.
What does stray \160 mean?
Okay, attach the same file here that creates the problem.
I am not sure if I can help you (its hard to replicate the configuration that you have) but one issue that I can think of could be line-end issue. Whenever you move a file saved in windows to linux/unix - there is a well-known problem related to the line ends. A special Cntrl-M character appears in the file when opened on unix - you could view them using vim. Try using the dos2unix command for the file and try compiling.
I will look further if I can help you - but don't rely on that.. have workarounds (I think you already have that). Regards.
File which gives this problem is attached. Any help is appreciated.
vi doesn't show any ^M, nor does a dos2unix command help.
J.