tfussell / xlnt

:bar_chart: Cross-platform user-friendly xlsx library for C++11+
Other
1.49k stars 418 forks source link

Load xlsx file with Unicode characters Path in Multibyte character set project #542

Closed NamSeungwoo closed 3 years ago

NamSeungwoo commented 3 years ago

Hello. I'm coding to make excel editor UI like an excel application using CGridCtrl at MFC framework. The CGridCtrl library works well in Multibyte character set project, but not Unicode character set project. So I'm keeping my project property Multibyte character set. However, I cannot load excel file with Unicode character set(But, It works when I changed my project property to Unicode). How can I load a excel file at my application(Multibyte character set) using xlnt::workbook::load(const std::string &filename) ?

void FileOpen::OpenExcelFileUsingXLNT(CString strPath) { xlnt::workbook wb; typedef std::basic_string tstring; tstring tmp = CStringToCharArr(strPath); // in Debug Mode, tmp = "D:\\프로그램\\example2.xlsx".

wb.load(tmp); }

char FileOpen::CStringTOCharArr(CString str) { int length = str.GetLength(); char st = new char[length]; strcpy(st, str.GetBuffer(0)); return st; }

Thank you for reading this.

IcyVizi commented 1 year ago

Have you find any solution?