Allow embedded double quotes, and hex-encode single quotes. Makes the

typical case a bit more readable.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29521 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2004-09-29 00:20:27 +00:00
parent b27a4ef40d
commit 9a9942f75a

View File

@@ -641,7 +641,7 @@ static wxString FileToPythonArray(wxString filename, int num)
size_t lng = file.Length(); size_t lng = file.Length();
snum.Printf(_T("%i"), num); snum.Printf(_T("%i"), num);
output = _T(" xml_res_file_") + snum + _T(" = \"\"\"\\\n"); output = _T(" xml_res_file_") + snum + _T(" = '''\\\n");
unsigned char *buffer = new unsigned char[lng]; unsigned char *buffer = new unsigned char[lng];
file.Read(buffer, lng); file.Read(buffer, lng);
@@ -654,7 +654,7 @@ static wxString FileToPythonArray(wxString filename, int num)
tmp = (wxChar)c; tmp = (wxChar)c;
linelng = 0; linelng = 0;
} }
else if (c < 32 || c > 127 || c == '"') else if (c < 32 || c > 127 || c == '\'')
tmp.Printf(_T("\\x%02x"), c); tmp.Printf(_T("\\x%02x"), c);
else if (c == '\\') else if (c == '\\')
tmp = _T("\\\\"); tmp = _T("\\\\");
@@ -671,7 +671,7 @@ static wxString FileToPythonArray(wxString filename, int num)
delete[] buffer; delete[] buffer;
output += _T("\"\"\"\n\n"); output += _T("'''\n\n");
return output; return output;
} }