Jump to content

[Solved] Ricky 500 Error caused by a foreign language string


arabich

Recommended Posts

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...