将MySQL UUID Unicode字符从JSON响应到PHP中的Hex
我在浏览器中使用MySQL错误获得了API响应。
在Create_at
)值 (\ u0027 \ ufffdl \ ufffd = \ ufffd \ ufffda \ uffda \ u01e0 \\\ f \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ uffd \ ufffd \ ufffd \ ufffd \ uffd \ \ u0027,\ u0027,\ u0027 \ u0027 \ u u 0010 \ ufffd \ u0019 \ ufffd \ u0370a \ ufffd \ ufffd \ ufffd \ ufffd \ ufffd \ ufffdv \ u001d \ ufffd \ ufffd \ uffd \ u0027,\ u00272022-2-07-04 14:57:24.766 \ u0027); \ u0027:\ n \ nsqlstate [23000]:完整性约束 违规:1452无法添加或更新子行:外键 约束失败(shopware
。category_certificate
,约束fk_9c7a6a4799223ffd
外键(cetidect_id
)参考category_certificate
(id
)删除级联)
我想找出此SQL查询中使用的UUID的十六进制。 Tried few things like json_decode, or mb_convert_encoding the \u0027\ufffdl\ufffd=\ufffd\ufffdA\u01e0\\\f\ufffd\ufffd\ufffd\ufffd\ufffd\u0027 string like mentioned here https://stackoverflow.com/a/a/6058533/7275814 ,但我总是只得到人类的unicode chars buthable Hex hex' UUID。如何将其转换为通过调试进行处理?
I get an API response with a mysql error in the browser.
INSERT INTO
category_certificate
(category_id
,certificate_id
,created_at
) VALUES
(\u0027\ufffdl\ufffd=\ufffd\ufffdA\u01e0\\\f\ufffd\ufffd\ufffd\ufffd\ufffd\u0027,\u0027\u0010\ufffd\u0019\ufffd\u0370A\ufffd\ufffd\ufffd\ufffdV\u001d\ufffd\u0027,\u00272022-07-04
14:57:24.766\u0027);\u0027:\n\nSQLSTATE[23000]: Integrity constraint
violation: 1452 Cannot add or update a child row: a foreign key
constraint fails (shopware
.category_certificate
, CONSTRAINTFK_9C7A6A4799223FFD
FOREIGN KEY (certificate_id
) REFERENCEScategory_certificate
(id
) ON DELETE CASCADE)
I want to find out the hex of the UUIDs used in this SQL query. Tried few things like json_decode, or mb_convert_encoding the \u0027\ufffdl\ufffd=\ufffd\ufffdA\u01e0\\\f\ufffd\ufffd\ufffd\ufffd\ufffd\u0027 string like mentioned here https://stackoverflow.com/a/6058533/7275814 but I always just get the unicode chars not the human readable hex'd UUID. How can I convert this, to process with debugging?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如@michas在评论中已经提到的那样,不可能从该字符串中重新获得原始二进制数据。如果您处于
dev
环境中,则应该能够查看对API请求的响应,并在标题X-下找到该请求的Symfony Profiler页面的URL debug-token-link
。在“ Profiler”页面上,如果您查看可运行的版本,则可以在“学说”选项卡下找到具有可读参数的查询。但是,它们可能无法阅读,因为当时UUID可能已经转换为二进制数据。然后,最好的选择将是“异常”选项卡,您可以在堆栈中找到一个曝光原始有效载荷的呼叫,例如呼叫apicontroller :: executeWritePoperation
。As @Michas already mentioned in a comment it is not possible to regain the original binary data from that string. If you're in a
dev
environment, then you should be able to look at the response to your API request and find a URL to the Symfony Profiler page for that request under the headerX-Debug-Token-Link
. On the Profiler page you might be able to find the Query under the Doctrine tab with readable parameters if you look at the runnable version. However they might not be readable there, as the UUIDs will probably have been converted to binary data already at that point. Then your best bet would be the Exception tab where you might be able to find a call in the stack that exposes the original payload, e.g. a call toApiController::executeWriteOperation
.