charset

四则运算自动出题系统——网页版

筅森魡賤 提交于 2019-12-03 09:56:17
第一个界面:输入题目总数和每行要显示的题目数 第二个界面:答题界面 第三个界面:判错界面,可选择重新回到第一个界面或进入第四个界面 第四个界面:结束界面 源码: 1.si.jsp 1 <%@ page language="java" contentType="text/html; charset=UTF-8" 2 pageEncoding="UTF-8"%> 3 <!DOCTYPE html> 4 <html> 5 <head> 6 <meta charset="UTF-8"> 7 <h2>四则运算自动出题系统</h2> 8 <style type="text/css"> 9 .big{ 10 position:absolute; 11 left:50%; 12 margin-left:-100px; 13 top:50%; 14 margin-top:-200px; 15 } 16 </style> 17 </head> 18 19 20 <body text="Black" style="background: ; background-size:100%"> 21 <div align="center"> 22 <form action="ze.jsp" method="post" onsubmit="return checkall()"> 23 <table> 24 <tr

python urllib error - AttributeError: &#039;module&#039; object has no attribute &#039;request&#039;

匿名 (未验证) 提交于 2019-12-03 08:59:04
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying out a tutorial code which fetches the html code form a website and prints it. I'm using python 3.4.0 on ubuntu. The code: import urllib.request page = urllib.request.urlopen("http://www.brainjar.com/java/host/test.html") text = page.read().decode("utf8") print(text) I saw previous solutions and tried them, I also tried importing only urllib but it still doesn't work. The error message displayed is as shown: Traceback (most recent call last): File "string.py", line 1, in <module> import urllib.request File "/usr/lib/python3.4

Http响应乱码

送分小仙女□ 提交于 2019-12-03 06:54:47
Http响应乱码 方案1 response.setHeader("Content-Type", "application/json"); response.setCharacterEncoding("GBK"); //Content-Type: application/json;charset=GBK //{code: "401", message: "未登录"} 方案2 response.setHeader("Content-Type", "application/json;charset=UTF-8"); //{code: "401", message: "未登录"} //Content-Type: application/json;charset=UTF-8 注意 只设置Content-Type不带编码信息无效 /* 只设置Content-Type,没有带编码信息,String中的中文是UTF16编码的。tomcat以其默认的ISO-8859-1从String中获取字节。tomcat附加在Content-Type的编码是charset=ISO-8859-1,浏览器会以这个编码解码,但是得不到原始中文信息。 */ response.setHeader("Content-Type", "application/json"); //{code: "401", message: "?

yml java.nio.charset.MalformedInputException: Input length = 1异常

余生长醉 提交于 2019-12-03 06:06:05
java.nio.charset.MalformedInputException: Input length = 1异常 java.nio.charset.MalformedInputException: Input length = 1 错误 1.其中一个最容易找的原因是interface 和 xml的 namespace 对应不上 还有一种情况是application.yml的编码问题,会导致去是添加resouce的配置(如下)时出现java.nio.charset.MalformedInputException: Input length = 1,mybatis也绑定不上。 此时应该做的的是将所有的编码都转为utf-8。此处idea为例 File --> Settings --> Editor —>File Encodings ,将所有的格式都转成utf-8格式 来源: CSDN 作者: 我是暗器啊 链接: https://blog.csdn.net/WoshiAnQia/article/details/84144814

css---8 过渡属性刨析

狂风中的少年 提交于 2019-12-03 04:06:14
1. transition-property 默认值为 all,表示所有可被动画的属性都表现出过渡动 可以指定多个 property 属性值: none 没有过渡动画。 all 所有可被动画的属性都表现出过渡动画。 IDENT 属性名称 (可以指定多个) transition-property: width,height; transition-duration: 9s,1s; 2 transition-duration 属性以秒或毫秒为单位指定过渡动画所需的时间。 默认值为 0s ,表示不出现过渡动画。 可以指定多个时长,每个时长会被应用到由 transition-property 指定的对应属性上。如果指定的时长个数小于属性个数,那么时长列表会重复。如果时长列表更长,那么该列表会被裁减。两种情况下,属性列表都保持不变。 属性值 以毫秒或秒为单位的数值 <time> 类型。表示过渡属性从旧的值转变到新的值所需要的时间。如果时长是 0s ,表示不会呈现过渡动画,属性会瞬间完成转变。不接受负值。一定要加单位(不能写0 一定要写0s 1s,0s,1s)! transition-property:width,background; <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title

How to generate javadoc documentation with umlauts?

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to generate Java documentation in Eclipse. The source files are UTF-8 encoded and contain some umlauts . The resulting HTML files do not specify an encoding and do not use HTML entities, so the umlauts aren't displayed correctly in any browser. What can I do to change this? 回答1: See the -charset , -encoding and -docencoding flags for the javadoc command . -encoding specifies the input encoding -docencoding specifies the output encoding -charset makes javadoc include a meta tag with encoding info 回答2: Modified from Eclipse javadoc

Very strange behaviour with UTF-8 [duplicate]

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This question already has an answer here: UTF-8 all the way through 14 answers How can I echo a sql text field into a paragraph? My code does puts the text in but changes the accents like á to this -> . I tried adding UTF-8 in the header and removing it. Removing UTF-A makes the sql content is ok but all the content outside the paragraph messes up. I checked the DB was using (UTF-8-unicode), The files were saved with UTF-8 Any ideas on what might be wrong? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <textarea class=

PHP PDO : Charset=UTF8 : An invalid keyword charset was specified in the dsn string

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am connecting to an MS SQL server with PDO using the sqlsrv driver. PHP version is 5.3.24. The working connection looks like this: $dsny = "sqlsrv:Server=xx1;Database=xx2"; $usery = 'xx3'; $passwordy = 'xx4'; $dbhy = new PDO($dsny, $usery, $passwordy); ** But i need to set characters, and then i try this: $dsny = "sqlsrv:Server=xx1;Database=xx2;charset=utf8"; $usery = 'xx3'; $passwordy = 'xx4'; $dbhy = new PDO($dsny, $usery, $passwordy); When i add the charset i get this error: "Fatal error: Uncaught exception 'PDFException' with message

HTTP/1.1 415 Cannot process the message because the content type &#039;application/json; charset=utf-8&#039; was not the expected type &#039;text/xml; charset=utf-8&#039;

匿名 (未验证) 提交于 2019-12-03 02:30:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: trying to POST json dictionary to C# WCF, when i invoke it HTTP Response 415. Someone can tell me whats wrong with my code. object Class [DataContract] public class Class1 { [DataMember] public string AccNo; [DataMember] public string CompanyName; [DataMember] public string DocDate; } IService1.cs [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "json/PostSalesOrderData", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)] string PostSalesOrderData(string data);

python操作数据库

戏子无情 提交于 2019-12-03 02:15:02
一、python操作mysql数据库 python3中操作mysql数据需要安装一个第三方模块,pymysql,使用pip install pymysql安装即可,在python2中是MySQLdb模块 import pymysql # 定义数据库的ip地址,账号、密码、端口号、要操作的数据库、字符集 ip = '111.11.1.11' user = 'xxx' password = '123456' db = 'xxx' port = 3306#默认端口号为3306,操作数据库端口号为默认值可以不传 charset = 'utf8' #数据库的字符集是utf8而不是utf-8 # 创建连接,指定数据库的ip地址,账号、密码、端口号、要操作的数据库、字符集 conn= pymysql.connect(host = ip,user = user,password = password,db = db,port = port ,charset = charset,autocommit=True) #增加autocommit=True参数,执行sql语句后自动提交 #创建游标 # cur= conn.cursor() cur= conn.cursor(pymysql.cursors.DictCursor) #pymysql.cursors.DictCursor指定游标类型为字典类型