Submitted by gouki on 2009, June 22, 3:05 PM
在查mysql 1366的错误原因时,发现一些有趣的回答。地址为:http://zhidao.baidu.com/question/59029575.html
不过,还是有人给出了比较好的解决方法:
- MySQL 1366错误大致描述如下
-
- 1. SQL Error: 1366: Incorrect string value: "\xE8\xAF\xA6\xE7\xBB\x86…" for column "address" at row 1
-
- 解决办法:检查数据库此字段的字符集与整理字符集是否与SQL语句传递数据的字符集相同;不相同则会引发MySQL1366错误。
-
- 修改MySQL该字段的字符集与整理规则即可。假设数据表为phplamp, SQL语句的字符集为utf8,出错的字段为address:
- MySQL 1366 错误解决办法
-
- 1. #检查数据表所有字段的状态
- 2. ->show full columns from phplamp;
- 3. #发现address字段的Collation项非utf8,修改它!
- 4. ->alter table phplamp change name name varchar(100) character set utf8 collate utf8_unicode_ci not null default '';
-
- 修改完字段的字符集后可以再使用show full columns from table_name命令检查一下,以确保万无一失。假如您的SQL字符集为GBK或是GB2312或是其它的话,只需要将数据表字段的字符集更改为其相应的编码即可。
-
- 再送上一个MySQL的命令:
- 修改数据表的字符集与整理
-
- 1. ->show full columns from table_name;
Tags: mysql, 1366
DataBase | 评论:0
| 阅读:29348
Submitted by gouki on 2009, June 22, 12:41 PM
Tags: 生日, 肖佑阳
Baby | 评论:4
| 阅读:21965
Submitted by gouki on 2009, June 22, 11:44 AM
phped是一款PHP IDE,用下来感觉还不错
但是有一个功能是我最受不了的
就是虚拟空格。。。
鼠标点到哪里,就可以直接在哪里进行输入。
对于页面的控制不太好。不知道哪里可以关掉
顺便,再请各位看到本文推荐一款IDE
1、项目管理方便点
2、没有虚拟空格
3、在项目中可以指定单个文件编码
4、对于类或者函数的提示速度要快,要完善
5、对于单例化的class或者工厂模式的CLASS要能够进行提示
这么多,应该是每个用IDE的人都想解决的问题吧?
不知道有没有哪个IDE能够提供。。。
Software | 评论:4
| 阅读:19200
Submitted by gouki on 2009, June 21, 11:08 PM
两个常用的JS代码
Utf8
-
-
-
-
-
-
-
- var Utf8 = {
-
-
- encode : function (string) {
- string = string.replace(/\r\n/g,"\n");
- var utftext = "";
-
- for (var n = 0; n < string.length; n++) {
-
- var c = string.charCodeAt(n);
-
- if (c < 128) {
- utftext += String.fromCharCode(c);
- }
- else if((c > 127) && (c < 2048)) {
- utftext += String.fromCharCode((c >> 6) | 192);
- utftext += String.fromCharCode((c & 63) | 128);
- }
- else {
- utftext += String.fromCharCode((c >> 12) | 224);
- utftext += String.fromCharCode(((c >> 6) & 63) | 128);
- utftext += String.fromCharCode((c & 63) | 128);
- }
-
- }
-
- return utftext;
- },
-
-
- decode : function (utftext) {
- var string = "";
- var i = 0;
- var c = c1 = c2 = 0;
-
- while ( i < utftext.length ) {
-
- c = utftext.charCodeAt(i);
-
- if (c < 128) {
- string += String.fromCharCode(c);
- i++;
- }
- else if((c > 191) && (c < 224)) {
- c2 = utftext.charCodeAt(i+1);
- string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
- i += 2;
- }
- else {
- c2 = utftext.charCodeAt(i+1);
- c3 = utftext.charCodeAt(i+2);
- string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
- i += 3;
- }
-
- }
-
- return string;
- }
-
- }
Base64
-
-
-
-
-
-
-
- var Base64 = {
-
-
- _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
-
-
- encode : function (input) {
- var output = "";
- var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
- var i = 0;
-
- input = Base64._utf8_encode(input);
-
- while (i < input.length) {
-
- chr1 = input.charCodeAt(i++);
- chr2 = input.charCodeAt(i++);
- chr3 = input.charCodeAt(i++);
-
- enc1 = chr1 >> 2;
- enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
- enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
- enc4 = chr3 & 63;
-
- if (isNaN(chr2)) {
- enc3 = enc4 = 64;
- } else if (isNaN(chr3)) {
- enc4 = 64;
- }
-
- output = output +
- this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
- this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
-
- }
-
- return output;
- },
-
-
- decode : function (input) {
- var output = "";
- var chr1, chr2, chr3;
- var enc1, enc2, enc3, enc4;
- var i = 0;
-
- input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
-
- while (i < input.length) {
-
- enc1 = this._keyStr.indexOf(input.charAt(i++));
- enc2 = this._keyStr.indexOf(input.charAt(i++));
- enc3 = this._keyStr.indexOf(input.charAt(i++));
- enc4 = this._keyStr.indexOf(input.charAt(i++));
-
- chr1 = (enc1 << 2) | (enc2 >> 4);
- chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
- chr3 = ((enc3 & 3) << 6) | enc4;
-
- output = output + String.fromCharCode(chr1);
-
- if (enc3 != 64) {
- output = output + String.fromCharCode(chr2);
- }
- if (enc4 != 64) {
- output = output + String.fromCharCode(chr3);
- }
-
- }
-
- output = Base64._utf8_decode(output);
-
- return output;
-
- },
-
-
- _utf8_encode : function (string) {
- string = string.replace(/\r\n/g,"\n");
- var utftext = "";
-
- for (var n = 0; n < string.length; n++) {
-
- var c = string.charCodeAt(n);
-
- if (c < 128) {
- utftext += String.fromCharCode(c);
- }
- else if((c > 127) && (c < 2048)) {
- utftext += String.fromCharCode((c >> 6) | 192);
- utftext += String.fromCharCode((c & 63) | 128);
- }
- else {
- utftext += String.fromCharCode((c >> 12) | 224);
- utftext += String.fromCharCode(((c >> 6) & 63) | 128);
- utftext += String.fromCharCode((c & 63) | 128);
- }
-
- }
-
- return utftext;
- },
-
-
- _utf8_decode : function (utftext) {
- var string = "";
- var i = 0;
- var c = c1 = c2 = 0;
-
- while ( i < utftext.length ) {
-
- c = utftext.charCodeAt(i);
-
- if (c < 128) {
- string += String.fromCharCode(c);
- i++;
- }
- else if((c > 191) && (c < 224)) {
- c2 = utftext.charCodeAt(i+1);
- string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
- i += 2;
- }
- else {
- c2 = utftext.charCodeAt(i+1);
- c3 = utftext.charCodeAt(i+2);
- string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
- i += 3;
- }
-
- }
-
- return string;
- }
-
- }
这两个应该是比较常用的了。不管是在AJAX中还是在其他中,都应该是很有用的
Tags: utf8, base64
Javascript | 评论:0
| 阅读:21511
Submitted by gouki on 2009, June 20, 10:42 AM
Tags: 肖佑阳, 一周岁, 阳历
Baby | 评论:14
| 阅读:31679