This is my first gist.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| This is a Text. |
Photobucket是一个提供影像寄存、视频寄存、幻灯片制作与照片分享服务网站,于2003年由Alex Welch与Darren Crystal利用Trinity Ventures提供的资金创。Photobucket一般会用作个人相册,寄存网络论坛上显示的头像以及视频的远端存放空间。
https://stackoverflow.com/a/11013986
I would not suggest Richies answer, because you are screwing up the data inside the database. You would not fix your problem but try to "hide" it and not being able to perform essential database operations with the crapped data.
If you encounter this error either the data you are sending is not UTF-8 encoded, or your connection is not UTF-8. First, verify, that the data source (a file, ...) really is UTF-8.
Then, check your database connection, you should do this after connecting:
SET NAMES 'utf8'; SET CHARACTER SET utf8;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ..\MySQL\MySQL Server 5.7\DATA\my.ini | |
| ------------这两个可以省略------------------------- | |
| [client] | |
| default-character-set=utf8mb4 | |
| [mysql] | |
| default-character-set=utf8mb4 | |
| -----------just use this---------------------------- | |
| # system-time-zone could be set in OS ENVIRON [TZ=CST-8:00], if mysql failed to get from os by default. | |
| # default-time-zone could be removed [SYSTEM by default] if system-time-zone is rightly getted by mysql. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Note:举例说明以中国时间为主体 | |
| 1.时区定义TZ | |
| 含义:CST代表时区的别名,后面的+8:00才是实际定义时区的; | |
| # 下面两个其实代表同一个时区,只是时区别名不一样,区别在于这里的名字ABC是非标准的. 但其实CST本身也有很多国家在用,比如美国、中国。 | |
| TZ=CST-8:00 | |
| TZ=ABC-8:00 | |
| # 默认为+0,当然-0也没毛病, 可不写出来;其实对于TZ来讲这时候标准别名应该用UTC,ZZZ是随意的一个名字。 | |
| TZ=ZZZ | |
| TZ=ZZZ+0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 先说解决方式: | |
| Windows TZ环境变量设置: | |
| TZ=CST-8:00 | |
| 以下为一些心得: | |
| MySQL的system_time_zone读取错误的问题,会导致以下类似命令出现Warning: | |
| show variables like '%time_zone%'; | |
| show variables like '%char%'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| r""" | |
| 本代码的例子:一个扩展平面字符,CJK统一表意文字扩展B第一个字符。(你的环境可能无法正确显示,实际字符可自行搜索代码点) | |
| https://unicode-table.com/en/20000/ | |
| 𠀀 | |
| U+20000 | |
| 1.Unicode编码标准 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 摘要算法Digest | |
| 特点:不可反解,单向计算;固定长度,不会保存也无法恢复原有资源。 | |
| MD5 128bit # 不够安全 | |
| SHA1: 即SHA160, 160bit | |
| SHA2: SHA-224、SHA-256、SHA-384、SHA-512、SHA-512/224、SHA-512/256等的统称 | |
| 作用: | |
| <1>一般是用来对密码进行加密存储【此加密非彼加密】,目的是防泄露密码明文。即便 | |
| 一个网站密码库被黑客攻破, 也不会让用户其他网站帐号遭受危险; | |
| <2>用来对一个资源生成摘要,接收者对资源也生成摘要来比对,防资源修改、缺失; |
OlderNewer