b“字符串"是什么?在dd()函数中意味着什么? [英] What does b"string" mean in dd() function?
问题描述
dd($result);
结果:
...
+description: "عند...ترنت."
+keywords: b"°ó¨Ü¨ü¨ê...Ü°®"
...
+keywords
在字符串前面有字母"b",说明中没有该字母……"b"是什么意思?如果可能的话,如何转换字符串?
+keywords
has the letter 'b' in front of the string, description does not have that... What does the 'b' mean? And if it is possible, how can I convert the string?
顺便说一句,如果我var_dump关键字,这是结果:
string(116) "���,����,�,��,����������,����������,��,��������,�������,������:"
Btw, this is the result if I var_dump the keywords:
string(116) "���,����,�,��,����������,����������,��,��������,�������,������:"
我认为它必须与字符集有关,我正在使用UTF-8.
I think it has to do something with charset, i'm using UTF-8.
推荐答案
如果您阅读:您可以看到https://symfony.com/doc/current/components/var_dumper.html (Laravel使用的是)
If you read: https://symfony.com/doc/current/components/var_dumper.html (which is what Laravel is using) you can see:
所以答案是字符串在UTF-8中无效(我猜b
代表二进制).
So the answer is the string is not valid in UTF-8 (I am guessing b
stands for binary).
也许还要检查是否可以检测到编码.
Maybe check if you can detect the encoding if it's something else.
这篇关于b“字符串"是什么?在dd()函数中意味着什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!