Blog Archive for July 13, 2012

Tomcat disable jsessionid on url

July 13, 2012

I had a problem with a Java web app hosted within a Tomcat container. I was posting out to a third party card provider to accept credit card details (this gets around the PCI-DSS issues of handing credit card numbers yourself) and they would then return back to a configured …

Removing non-ascii chars from a string in Python

July 13, 2012

I was processing some data from a database table, and the process was failing if a non-ascii character was passed. I didn't mind losing these characters, so needed a way to remove them from my string before processing.

This function can do that in Python:

def _removeNonAscii(s): …