Copying code in Windows Edge

Everything else that doesn't fall into one of the other PB categories.
tastyraspberry
User
User
Posts: 39
Joined: Fri Sep 28, 2012 10:22 am

Copying code in Windows Edge

Post by tastyraspberry »

Hi all,

I seem to be having trouble copying (Ctrl + C, or Right click) code from the forum. I am using Windows Edge but when I copy a (random sample) eg

Code: Select all

InitSprite() 
InitKeyboard() 

#ScreenWidth  = 1024 
#ScreenHeight = 768 
#ScreenBits  = 32 
#MiddleX  = #ScreenWidth  / 2 
#MiddleY  = #ScreenHeight / 2 
#Radius = 600

Define grad.f = 0

Structure Vector
x.f
y.f
EndStructure
I get a lot of syntax errors when compiling it. It seems, after copying it into Notepad++ and then changing the encoding to ANSI I get a lot of  symbols inserted into the text which throws the compiler.

Code: Select all

InitSprite() 
InitKeyboard() 

#ScreenWidth  = 1024 
#ScreenHeight = 768 
#ScreenBits   = 32 
#MiddleX      = #ScreenWidth  / 2 
#MiddleY      = #ScreenHeight / 2 
#Radius       = 600

Define grad.f = 0

Structure Vector
  x.f
  y.f
EndStructure
My questions are:
Is there a quick fix to this?

Should I change the encoding of PB (I am a bit wary of changing things as I nearly always to forget what I've changed and then I'm in a complete mess)?

Should I just change my browser?
Can I fix it from the browser?

I will continue to investigate but would welcome any feedback or similar issues.

Michael
User avatar
Bisonte
Addict
Addict
Posts: 1316
Joined: Tue Oct 09, 2007 2:15 am

Re: Copying code in Windows Edge

Post by Bisonte »

You should go to Preferences -> Compiler -> Defaults -> and here : Source File Text Encoding : UTF8 ! (not Plain Text)
PureBasic 6.21 (Windows x64) | Windows 11 Pro | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
English is not my native language... (I often use DeepL.)
tastyraspberry
User
User
Posts: 39
Joined: Fri Sep 28, 2012 10:22 am

Re: Copying code in Windows Edge

Post by tastyraspberry »

Well, yes, I did that but the problem persists. When I copy from the website to the editor I get lots of 'xA0' (if I 'reveal' them with notepad++) pasted in and it really doesn't like it. It always throws an syntax error.

I'm a bit perplexed now..

Michael
Post Reply