arabich Posted March 19, 2020 Share Posted March 19, 2020 (edited) Greeting, This a newpie here, I got a problem (500 error) with the server caused by this code new_message = "<p dir=\"rtl\" lang=\"ar\" style=\"color:#e0e0e0;font-size:20px;\">رَبٍّ زِدْنٍي عِلمًا</p>" it works with my python shell, but not on the server, is the server cgi files can't take a foreign language? or is it my code? I'm not sure what to do to fix this. Please help me out! Thank you so much!! I appreciate your hard work UPDATE: FIXED! Thank you a lot UPDATE: FIXED! Thank you a lot Edited March 19, 2020 by arabich Quote Link to comment Share on other sites More sharing options...
loratadi Posted March 19, 2020 Share Posted March 19, 2020 I guess there might be different versions of Python on your machine and the server. You can try marking the string literal with the , like this [new_message = u'....'] and putting the utf-8 pragma [# coding: utf-8] at the top of your files.That may make it work on the server, and possibly fail on your machine, depending on the versions. Quote Link to comment Share on other sites More sharing options...
arabich Posted March 19, 2020 Author Share Posted March 19, 2020 (edited) I guess there might be different versions of Python on your machine and the server. You can try marking the string literal with the , like this [new_message = u'....'] and putting the utf-8 pragma [# coding: utf-8] at the top of your files.That may make it work on the server, and possibly fail on your machine, depending on the versions.Thank you for answering!! Following your solution, now: it doesn't give a 500 error regarding non-English String, however it still can't be printed The only way to print it, is as a "unicode", generating this output u'\u0627\u0644\u0643\u0648\u0646 \u0647\u0648 other than that nothing even shows on the screen. I'm sorry for such a bad explanation, and thank you very much for replying!! UPDATE: FIXED! Thank you a lot Edited March 19, 2020 by arabich Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.