#!c:/python34/python.exe
# -*- coding: utf-8 -*-

import sys
import cgi
import json

import ast

print('Content-type: text/plain')
print()
data = json.loads(sys.stdin.read())
print(ast.dump(ast.parse(data["py_source"]), indent = 4))

@@ -136,50 +136,126 @@
 t()%0A
-data = json.loads(sys.stdin.read())%0Aprint(
+%0Asource = sys.stdin.read()%0A%0Adata = json.loads(source)%0Asource = data%5B%22py_source%22%5D%0Ab = source.encode('utf-8')%0A%0Aresult = 
 ast.
@@ -269,33 +269,22 @@
 t.parse(
-data%5B%22py_
 source
-%22%5D
 ), inden
@@ -289,10 +289,82 @@
 ent = 4)
-)
 %0A
+result = result.encode('utf-8').decode(sys.stdout.encoding)%0Aprint(result)

Update cgi-bin/dump_ast.py