- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我在追查为什么我的 MariaDB Windows 开发安装与我的 FreeBSD 安装不匹配时遇到了一些麻烦。这是我在 freeBSD 上的测试数据库的一些输出:
MariaDB [www]> SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';
+--------------------------+--------------------+
| Variable_name | Value |
+--------------------------+--------------------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| collation_connection | latin1_swedish_ci |
| collation_database | utf8mb4_unicode_ci |
| collation_server | latin1_swedish_ci |
+--------------------------+--------------------+
10 rows in set (0.00 sec)
MariaDB [www]> SHOW FULL COLUMNS FROM items;
+-------------+--------------+--------------------+------+-----+---------+----------------+---------------------------------+---------+
| Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |
+-------------+--------------+--------------------+------+-----+---------+----------------+---------------------------------+---------+
| id | int(11) | NULL | NO | PRI | NULL | auto_increment | select,insert,update,references | |
| description | varchar(255) | utf8mb4_unicode_ci | YES | | NULL | | select,insert,update,references | |
+-------------+--------------+--------------------+------+-----+---------+----------------+---------------------------------+---------+
2 rows in set (0.01 sec)
MariaDB [www]> select description from items where id=15;
+------------------------+
| description |
+------------------------+
| 15 kΩ 1/8W 1% (smd) |
+------------------------+
1 row in set (0.00 sec)
这是 Windows 上的等价物:
MariaDB [www]> SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';
+--------------------------+--------------------+
| Variable_name | Value |
+--------------------------+--------------------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| collation_connection | latin1_swedish_ci |
| collation_database | utf8mb4_unicode_ci |
| collation_server | latin1_swedish_ci |
+--------------------------+--------------------+
10 rows in set (0.01 sec)
MariaDB [www]> SHOW FULL COLUMNS FROM items;
+-------------+--------------+--------------------+------+-----+---------+----------------+---------------------------------+---------+
| Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |
+-------------+--------------+--------------------+------+-----+---------+----------------+---------------------------------+---------+
| id | int(11) | NULL | NO | PRI | NULL | auto_increment | select,insert,update,references | |
| description | varchar(255) | utf8mb4_unicode_ci | YES | | NULL | | select,insert,update,references | |
+-------------+--------------+--------------------+------+-----+---------+----------------+---------------------------------+---------+
2 rows in set (0.01 sec)
MariaDB [www]> select description from items where id=15;
+------------------------+
| description |
+------------------------+
| 15 kΩ 1/8W 1% (smd) |
+------------------------+
1 row in set (0.00 sec)
所以我的问题是,在设置比较方面我遗漏了什么可能是 Windows 上损坏字符 (Ω) 的来源,以及需要将其更改为什么才能获得相同的字符我的 FreeBSD 服务器。 FreeBSD 安装稍新 10.1.23-MariaDB FreeBSD Ports 与 10.1.19-MariaDB mariadb.org 二进制分发版。
最佳答案
问题#1:始终使用 utf8(或 utf8mb4)。 latin1
没有 Ω
。你很幸运能在任何一个系统上看到它。请参阅 Trouble with utf8 characters; what I see is not what I stored 中的“最佳实践”
问题 #2: 在 Windows 上,cmd
不一定默认支持 UTF-8。命令“chcp”控制“代码页”。 chcp 65001
提供 UTF-8,但它也需要安装一个特殊的字符集。要在控制台窗口中设置字体:右键单击窗口标题 → 属性 → 字体 → 选择 Lucida Console 。
检查:要查看数据是否正确存储(在整个更改为 utf8mb4 之后),SELECT HEX(...) ...
查看您是否得到CEA9
用于 Omega。如果你得到 C38EC2A9
,你就有了“双重编码”。当以 UTF-8 编码时,其他希腊字母将是 CExx
或 CFxx
。
关于mysql - Windows 与 freeBSD 上的 MariaDB 字符集和排序规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45931319/
我正在使用使用jetty的Spring-Web应用程序: org.springframework.boot spring-boot-starter-web
我想匹配空格字符( )仅当它们后跟一个哈希( # )。 这是什么( #)下面是尝试做的,这是一个捕获组。 (我尝试转义括号,否则无法在组集中正确识别括号)。但是,这是行不通的。 下面的正则表达式 /#
我正在实现一个词法扫描器。我如何实现字符集?大多数字符集都采用范围形式,即 A-Z、h-L 等。我必须检查字符 ch 是否是字符集的成员。除了数组和位集之外,我可以在 Java 中使用哪种高效的数据结
我今天注意到我们的数据库使用字符集“utf8 -- UTF-8 Unicode”和排序规则“utf8_general_ci”,但里面的大多数表和列都使用 CHARSET=latin1。我会遇到任何问题
我有一个包含多种语言的 Mysql 表,一种语言一个字段。 我的字符集是utf_general_ci 当我用 phpMyAdmin 查看表格时,我有一个保加利亚语页面,如下所示: За наÑ
根据 MSDN vb.net uses this extended character set .根据我的经验,它实际上使用了这个: 我错过了什么?为什么它说它使用一个而使用另一个? 难道我做错了什么
我在 Symfony2 中有一个项目,它在我的本地主机上运行良好,但是在将其移动到外部服务器后问题已经开始。 我没有从包含波兰语字符的数据库中看到任何结果名称 在 Profiler 中,我检查了查询:
我更新了我的网络应用程序以使用 UTF-8 而不是 ANSI。 我做了以下措施来定义字符集: mysql_set_charset("utf8"); // PHP // HTML utf8_gener
typedef unsigned char Set; Set s1,s2; s1 = 0xda; PRINT(s1); printf("%d\n", s1); s2 = -s1; pri
我有一个 PHP/MySQL 应用程序,它需要在幕后处理 UTF-8 字符(UTF-8 字符不会显示在屏幕上)。 UTF-8 字符来自 PHP cURL 请求。 我需要做什么才能使 PHP 和 MyS
我正在使用 utf8_general_ci 作为字符集在 MySQL 中构建一个用户表。 1-) 使用这个字符集,两个用户一个叫 Bob 另一个叫 bob 看起来是同一个,对吧?我不知道这可能会导致一
我知道之前已经回答过这个问题,但我发现的解决方案不适用于我的系统(我已经测试过了)。 我想更改 Mysql 中的默认排序规则。这似乎设置为 latin1_swedish_ci,我想将其更改为 UTF8
我正在开发一个母语学习应用程序。我需要将一些字符存储为“ẽũ”。我的数据库设置为具有默认排序规则的 utf-8 字符集,以及受此字符影响的表。 问题是当我尝试使用常规 SQL 插入添加一行时: INS
有什么方法可以定义字符集,以及属于 的其他信息吗? jsFiddle 上的标签? 我知道他们侧面板的“信息”部分,但不允许 标签。 提前致谢! 最佳答案 是的,把它放在CSS部分: 使用 jQ
我正在创建一个对象运行时: var myObj = {}; myObj[propertyName] = propertyValue; propertyName 是变量,如果它像“a.b”,我的对象就有
假设我有一个值为 42 (*) 的字符。我需要在 n 行中打印这个字符,n 由用户定义。但是,对于每个换行,都必须打印另一个 *。如果用户输入“6”,那么结果将是这样的: * ** *** ****
该标准定义了 基本源字符集 基本执行字符集及其对应的宽字符 它还定义了“执行字符集”及其对应的宽字符,如下所示 $2.2/3- "The execution character set and the
我想 ping 目标 IP 地址并接收响应。为此,我在 Java 中使用带有 runtime.exec 方法和进程类的 Windows 命令行。我正在使用 inputStreamReader 获取响应
是否有任何方法可以更改 MySQL Workbench 字符集?我的架构使用 UTF-8,当我查看表数据(另存为 UTF-8)或手动添加数据时,出现字符集错误,可能 MySQL Workbench 使
我有一个文本选择/规范对话框,用户可以从列表中指定字体,设置粗体、斜体等。然后我使用 LOGFONT 中的信息创建一个 CFont 随后在 CEdit 中用作预览。 但是,如果用户选择像 Wingdi
我是一名优秀的程序员,十分优秀!