Index: /issm/trunk-jpl/src/m/coordsystems/epsg2proj.m
===================================================================
--- /issm/trunk-jpl/src/m/coordsystems/epsg2proj.m	(revision 25049)
+++ /issm/trunk-jpl/src/m/coordsystems/epsg2proj.m	(revision 25050)
@@ -10,9 +10,22 @@
 %      return proj4string='+proj=longlat +datum=wgs84 +no_defs'
 %
-
-	[s,r]=system(['gdalsrsinfo epsg:' num2str(epsg) ' | grep PROJ.4 | sed "s/PROJ.4 : //"']);
+	% First, get GDAL version
+	[s,r]=system(["gdalsrsinfo --version | awk '{print $2}' | cut -d '.' -f1"]);
 
 	if s~=0, 
 		error(r);
 	end
+
+	version_major=str2num(r)
+
+	[s,r]=system(["gdalsrsinfo epsg:" num2str(epsg) " | grep PROJ.4 | tr -d '\n' | sed 's/PROJ.4 : //'"]);
+
+	if s~=0, 
+		error(r);
+	end
+
+	if version_major==1,
+		r=r(2:end-1);
+	end
+
 	string=(r);
Index: /issm/trunk-jpl/src/m/coordsystems/epsg2proj.py
===================================================================
--- /issm/trunk-jpl/src/m/coordsystems/epsg2proj.py	(revision 25049)
+++ /issm/trunk-jpl/src/m/coordsystems/epsg2proj.py	(revision 25050)
@@ -1,4 +1,4 @@
-import shlex
 import subprocess
+
 
 def epsg2proj(epsg): #{{{
@@ -15,14 +15,26 @@
 
     TODO:
-        - Implement try/catch for proc.communicate()
-            - In case of Python 2, except socket.timeout: https://docs.python.org/3/library/socket.html?highlight=socket%20timeout#socket.timeout
-            - In case of Python 3, except TimeoutExpired: https://docs.python.org/3/library/subprocess.html#subprocess.SubprocessError
+    - Implement try/catch for proc.communicate()
+        - In case of Python 2, except socket.timeout: https://docs.python.org/3/library/socket.html?highlight=socket%20timeout#socket.timeout
+        - In case of Python 3, except TimeoutExpired: https://docs.python.org/3/library/subprocess.html#subprocess.SubprocessError
     '''
-    args = 'gdalsrsinfo epsg:%s | grep PROJ.4 | sed "s/PROJ.4 : //"' % epsg
-    proc = subprocess.Popen(args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+
+    #First, get GDAL version
+    args = "gdalsrsinfo --version | awk '{print $2}' | cut -d '.' -f1"
+    proc = subprocess.Popen(args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     outs, errs = proc.communicate()
-    
-    if errs != None:
-        raise RuntimeError('epsg2proj: call to gdalsrsinfo failed: %s' % errs)
+    if errs != '':
+        raise RuntimeError("epsg2proj: call to gdalsrsinfo failed: {}".format(errs))
+
+    version_major=int(outs)
+
+args = "gdalsrsinfo epsg:{} | grep PROJ.4 | tr -d '\n' | sed 's/PROJ.4 : //'".format(epsg)
+proc = subprocess.Popen(args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+outs, errs = proc.communicate()
+if errs != '':
+    raise RuntimeError("epsg2proj: call to gdalsrsinfo failed: {}".format(errs))
+
+    if version_major == 1:
+        r = r[1:-1]
 
     return outs
