[英]Alternative to u'' for unicode strings
I have the following asp script which uses python 2.5: 我有以下使用python 2.5的asp脚本:
<%@ Language = Python CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="sv" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
Jellö Wörld<br>
<%
Response.Write(u'Hellö Wörld<br>')
%>
</body>
</html>
It works correctly, hurrah! 它正常工作,哇! However, it will become annoying if I have to use u'' all over the place.
但是,如果我必须在各处使用u'',将变得很烦人。 What alternatives are there?
有哪些替代方案? Is there any future I can import so that I can have python3 like strings?
我可以导入任何将来的东西,以便像字符串一样使用python3吗?
Thanks for your help, 谢谢你的帮助,
Barry. 巴里
from __future__ import unicode_literals
但是,您将需要2.6或更高版本才能起作用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.