Open magreenblatt opened 3 years ago
What CEF version? How does it behave in Google Chrome at the same version? It appears that you are not providing encoding information via the filename*
directive as required.
Original comment by dingX wan (Bitbucket: Wanding, GitHub: Wanding).
@{557058:2f2a2aee-b500-4023-9734-037e9897c3ab} But there is no problem with the file name downloaded from Google browser, Google downloads it is "商品概况_数据概览_全部渠道_2021-05-26 (1).xls". using CEF, it was called exportSummaryData.ajax. Maybe it has nothing to do with garbled code, because the Google debug window also shows the previous part of the Chinese garbled code, but it downloaded the file name is normal .This bug has nothing to do with the CEF version. It's been bothering me for a long time @ Marshall Greenblatt
Original comment by dingX wan (Bitbucket: Wanding, GitHub: Wanding).
@{557058:2f2a2aee-b500-4023-9734-037e9897c3ab}
I've debugged the interface associated with downloading the CefDownloadHandler class
OnBeforeDownload(CefRefPtr
CefRefPtr
const CefString& suggested_name,
CefRefPtr
Suggested_name in MacOS CEF is “exportSummaryData.ajax", but in Windows CEF is "商品概况_数据概览_全部渠道_2021-06-26 (1).xls"
This has been a problem with all CEF releases, including the latest, and has bothered me for years
Original comment by dingX wan (Bitbucket: Wanding, GitHub: Wanding).
@{557058:2f2a2aee-b500-4023-9734-037e9897c3ab} Thanks for your answers. I noticed a phenomenon. The POST request have the Content-Type field, because I found that the GET request does not have this field.This field sets the encoding format. I don't know if it's related to this bug
Interesting that the wrong file name (“exportSummaryData.ajax”) only appears on MacOS. I’m not aware of any platform-specific code related to this in CEF. Can you run both the MacOS and Windows versions in a debugger and see if you can identify where the code differs?
Original comment by dingX wan (Bitbucket: Wanding, GitHub: Wanding).
@{557058:2f2a2aee-b500-4023-9734-037e9897c3ab} I glad receive your answers. It is clear that it has nothing to do with the version, the Windows version is always fine, but the MacOS version is always wrong. The Windows team and I have not been able to understand the reason, and the preliminary conclusion should be the CEF kernel code problem. Moreover, in the official demo provided, the file name after downloading is different from Windows and MacOS. If you would like me to provide the address of the web page in question, including how to repeat the question, I would be happy to do so
If you would like me to provide the address of the web page in question, including how to repeat the question, I would be happy to do so
That would help, thanks.
Original comment by dingX wan (Bitbucket: Wanding, GitHub: Wanding).
@Marshall Greenblatt I don't think I can figure out why。 I think it's the file name encoding problem。
"\U0000fffd\U0000fffdƷ\U0000fffdſ\U0000fffd_\U0000fffd\U0000fffd\U0000fffdݸ\U0000fffd\U0000fffd\U0000fffd_ȫ\U0000fffd\U0000fffd\U0000fffd\U0000fffd\U0000fffd\U0000fffd_2021-07-19.xls" I think the file name encoding is wrong, but I can't find how to solve it
Original report by dingX wan (Bitbucket: Wanding, GitHub: Wanding).
The requested url is https://sz.jd.com/sz/api/productDetail/exportSummaryData.ajax, and the suggested_name file name is exportSummaryData.ajax. However, this is not the filename I wanted. I checked Content-Disposition, ��Ʒ�ſ�_���ݸ���_ȫ������_2021-05-25.xls, but it is a messy filename, probably because it contains Chinese
Content-disposition: attachment;charset=utf-8;filename=��Ʒ�ſ�_���ݸ���_ȫ������_2021-05-25.xls
Note that the MacOS CEF library does this, Windows CEF lib and google have the correct file name