
Strange characters in shared code
Strange characters in shared code
Someone just sent me an email with some PureBasic code, but when I paste it into the IDE to compile, I get a syntax error. I pasted to Notepad and saw no issues, so I pasted into a hex editor and saw these strange characters. Any ideas?


Last edited by BarryG on Thu Mar 14, 2024 7:50 am, edited 1 time in total.
Re: Strange characters in shared code
Replace E2 80 82 with a space (32)
Re: Strange characters in shared code
Yep, but more worried that this is a copy issue with code from the IDE?
Re: Strange characters in shared code
What does the IDE have to do with it? You were given this code initially. I can assume that there are a lot of spaces in Unicode (9, 32, 160), as well as the dash symbol of different widths.
Code: Select all
Debug "|" + Chr(9) + "|"
Debug "|" + Chr(32) + "|"
Debug "|" + Chr(160) + "|"
Debug "|" + Chr($2002) + "|"
Debug "|" + Chr($2003) + "|"
Debug "|" + Chr($2004) + "|"
Debug "|" + Chr($2005) + "|"
Debug "|" + Chr($2006) + "|"
Debug "|" + Chr($2009) + "|"
Debug "|" + Chr($200A) + "|"
Debug "||"Re: Strange characters in shared code
It was copied from the IDE of one user and emailed to me. I pasted it into the IDE and it doesn't compile due to those invisible characters at the start of every line. Kind of makes sharing code by email 100% useless, don't you think?
Re: Strange characters in shared code
The mail editor could have broken the code.
Re: Strange characters in shared code
Fair call.
Re: [Done] Strange characters in shared code
What encoding was the file sent in? If in ANSI, then characters 128-255 will be broken.
Re: [Done] Strange characters in shared code
It was in the body of an email (Gmail). Not an attachment. I just copied the email text, pasted it into the IDE, and tried to compile it. Syntax error. So yeah, probably Gmail broke it. Here's how it looks in Gmail, and how I copied it. You'd assume you could just paste that into the IDE and run it, right?


Re: [Done] Strange characters in shared code
No.BarryG wrote: Thu Mar 14, 2024 8:09 am [...] You'd assume you could just paste that into the IDE and run it, right?
[...]
Email clients don't follow any standard.
They each have their idiosyncratic rules and complications.
They just watched the parade as HTML evolved to version 5...
PB Forums : Proof positive that 2 heads (or more...) are better than one 
-
Little John
- Addict

- Posts: 4805
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: Strange characters in shared code
Sharing code in the body of an e-mail actually is not a good idea.BarryG wrote: Thu Mar 14, 2024 7:36 am Kind of makes sharing code by email 100% useless, don't you think?
Better attach your .pb file(s) to the mail.
Re: Strange characters in shared code
Little John wrote: Sun Mar 31, 2024 5:57 pm […]
Sharing code in the body of an e-mail actually is not a good idea.
Better attach your .pb file(s) to the mail.
Exactly… as BarryG clearly experienced.
PB Forums : Proof positive that 2 heads (or more...) are better than one 