Permalink
Browse files

dxfrw: fixed an osx crash, possibly bug#3597944

  • Loading branch information...
1 parent c360cfc commit fb6b20d4b6432a7f8a7ff041ba5bdd10c1bcc892 Dongxu Li committed Dec 29, 2012
Showing with 4 additions and 5 deletions.
  1. +4 −5 libraries/libdxfrw/src/drw_textcodec.cpp
@@ -1,6 +1,7 @@
#include "drw_textcodec.h"
#include <sstream>
#include <iomanip>
+#include <algorithm>
#include "drw_base.h"
#include "drw_cptables.h"
#include "drw_cptable932.h"
@@ -412,11 +413,9 @@ std::string DRW_Conv932Table::toUtf8(std::string *s) {
}
std::string DRW_TextCodec::correctCodePage(const std::string& s) {
- std::string cp;
- std::stringstream ss;
- ss << std::uppercase << s;
- ss >> cp;
-
+ //stringstream cause crash in OS/X, bug#3597944
+ std::string cp=s;
+ transform(cp.begin(), cp.end(), cp.begin(), toupper);
//Latin/Thai
if (cp=="ANSI_874" || cp=="CP874" || cp=="ISO8859-11" || cp=="TIS-620") {
return "ANSI_874";

0 comments on commit fb6b20d

Please sign in to comment.