Jump to content

Recommended Posts

Posted (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 by arabich
Posted

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.

Posted (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 by arabich

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...