From afaf0f89ff364142300f6dc9bb30382baeebd6fe Mon Sep 17 00:00:00 2001 From: Daniel Neis Araujo Date: Wed, 4 Apr 2012 09:19:54 -0300 Subject: [PATCH] =?UTF-8?q?Fixing=20a=20problem=20with=20file=20encoding?= =?UTF-8?q?=20(credits:=20Ant=C3=B4nio=20Carlos=20Mariani)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the submitted file is not utf8, the SOAP fails to send the file. Doing a utf8_encode solve the problem. --- judge/ideone/lib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/judge/ideone/lib.php b/judge/ideone/lib.php index 944881fb..f16cced5 100644 --- a/judge/ideone/lib.php +++ b/judge/ideone/lib.php @@ -139,6 +139,10 @@ function judge() { break; } + if (!mb_detect_encoding($source, "UTF-8", true)) { + $source = utf8_encode($source); + } + $status_ideone = array( 0 => ONLINEJUDGE_STATUS_PENDING, 11 => ONLINEJUDGE_STATUS_COMPILATION_ERROR,