Skip to content
Extraits de code Groupes Projets
Valider a0394999 rédigé par Niels Martin Hansen's avatar Niels Martin Hansen
Parcourir les fichiers

When writing an UTF-8 memory subtitle file, also include a BOM to keep VSFilter happy.

Originally committed to SVN as r5789.
parent e2d75337
Aucune branche associée trouvée
Étiquettes
Aucune requête de fusion associée trouvée
...@@ -201,12 +201,17 @@ void AssFile::SaveMemory(std::vector<char> &dst,const wxString encoding) { ...@@ -201,12 +201,17 @@ void AssFile::SaveMemory(std::vector<char> &dst,const wxString encoding) {
dst.clear(); dst.clear();
dst.reserve(0x4000); dst.reserve(0x4000);
// Write file
entryIter cur; entryIter cur;
unsigned int lineSize = 0; unsigned int lineSize = 0;
unsigned int targetSize = 0; unsigned int targetSize = 0;
unsigned int pos = 0; unsigned int pos = 0;
wxCharBuffer buffer; wxCharBuffer buffer;
// Put a BOM
dst.resize(3);
dst[0] = '\xef'; dst[1] = '\xbb'; dst[2] = '\xbf';
pos += 3;
// Write the rest
for (cur=Line.begin();cur!=Line.end();cur++) { for (cur=Line.begin();cur!=Line.end();cur++) {
// Convert // Convert
wxString temp = (*cur)->GetEntryData() + _T("\r\n"); wxString temp = (*cur)->GetEntryData() + _T("\r\n");
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter