【发布时间】:2019-06-03 05:25:49
【问题描述】:
您好,抱歉,如果这篇文章很愚蠢,但我需要知道我是否有这样的 Java 字符串。
final String string = "myNastyString";
for(int i=0;i<string.length();i++){
System.out.println((int)string.charAt(i));
}
我想知道 char 的 int 值或 char 本身在 MySQL 中将使用多少字节。
请多多关照,非常感谢。是的,我做了一些研究。
类似的东西。
51 3 would use X bytes in a mysqlTable{X}
32 would use X bytes in a mysqlTable{X}
67 C would use X bytes in a mysqlTable{X}
100 d would use X bytes in a mysqlTable{X}
115 s would use X bytes in a mysqlTable{X}
32 would use X bytes in a mysqlTable{X}
70 F would use X bytes in a mysqlTable{X}
114 r would use X bytes in a mysqlTable{X}
233 é would use X bytes in a mysqlTable{X}
65533 � would use X bytes in a mysqlTable{X}
68 D would use X bytes in a mysqlTable{X}
233 é would use X bytes in a mysqlTable{X}
65533 � would use X bytes in a mysqlTable{X}
82 R would use X bytes in a mysqlTable{X}
105 i would use X bytes in a mysqlTable{X}
99 c would use X bytes in a mysqlTable{X}
32 would use X bytes in a mysqlTable{X}
67 C would use X bytes in a mysqlTable{X}
104 h would use X bytes in a mysqlTable{X}
111 o would use X bytes in a mysqlTable{X}
112 p would use X bytes in a mysqlTable{X}
105 i would use X bytes in a mysqlTable{X}
110 n would use X bytes in a mysqlTable{X}
32 would use X bytes in a mysqlTable{X}
40 ( would use X bytes in a mysqlTable{X}
77 M would use X bytes in a mysqlTable{X}
97 a would use X bytes in a mysqlTable{X}
115 s would use X bytes in a mysqlTable{X}
116 t would use X bytes in a mysqlTable{X}
101 e would use X bytes in a mysqlTable{X}
114 r would use X bytes in a mysqlTable{X}
112 p would use X bytes in a mysqlTable{X}
105 i would use X bytes in a mysqlTable{X}
101 e would use X bytes in a mysqlTable{X}
99 c would use X bytes in a mysqlTable{X}
101 e would use X bytes in a mysqlTable{X}
115 s would use X bytes in a mysqlTable{X}
41 ) would use X bytes in a mysqlTable{X}
我的意思是每个值 aka char 将在 mysql 中使用多少字节,因为我正在使用 latin1_swedish_ci 排序规则我需要进行验证,以防任何字符不适合我的表
我想知道 myString 中的字符何时会在 MYSQl 表中消耗超过 1 个字节
【问题讨论】:
-
在我看来,你只是有点令人困惑,因为你问 Java MySQL 将使用多少字节作为字符串。 MySQL 使用的字节数取决于 DB 中的字段编码
-
嗨,请查看我编辑的问题,谢谢。