Blog2004 ≫ URL Encoding

Had a hiccup when trying to make content management system convert any content that's past through it to be valid HTML... my code for converting ampersands in URLs was messing about, making some bad URLs... so how do I convert & into & without converting any that are already good? Maybe I just put it in the wrong place, but my snippet of code like (unencoding all, then encoding them back) was having none of it, and this google search1 brings up a very wrong answer first of all... Actually if my content mangement system is messed up, that code snippet won't even display right, I'm converting encoded ampersands to normal ampersands, and then back again...

The thing that's highlighted this is there seems to be another David Devant gig booked, at York Fibbers, see here, though the ticket link there may still be broken when you read this, and I don't think that's the right ticket link anyway as the gig's not on sale yet, and not even listed on fibbers.co.uk2... to the drawing board with that, and with my new Barfly RSS feeds, I've tried to include images, and messed it up...

⬅️ :: ➡️

Paul Clarke's blog - I live in A small town, Kent. Married to Clare + father to two, I'm a full-stack web engineer, and I do mostly js / nodejs, some ruby, python, php ect ect. I like pubbing, parkrun, eating, home-automation + other diy jiggery-pokery, history, genealogy, Television, squirrels, pirates, lego, and time travel.