开发者

"UnicodeEncodeError",'charmap' codec can't encode characters In Django

开发者 https://www.devze.com 2023-01-26 01:23 出处:网络
I am working with Django. I have a HTML form which collects information from the user,wrote a function which post the value.But when I amtrying to render the value to an URL.(Example:return of the fu

I am working with Django. I have a HTML form which collects information from the user,wrote a function which post the value.But when I amtrying to render the value to an URL.(Example:return of the function is like:http://api.test.com?search=topic?title=USA).

But it shows UnicodeEncodeError with

'charmap' codec can't encode characters

I googled and try to solve from other solution found.Such as using external l开发者_Go百科ibraries.

Actually,I want to add user parameter within URL that will be shown in a text area.

How can I do that?


You should use Urllib.urlencode to create get parameters to be added to the url.

I guess, that should solve your problem

0

精彩评论

暂无评论...
验证码 换一张
取 消