summaryrefslogtreecommitdiff
path: root/cpp/src/Freeze/MapDb.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2014-05-02 19:56:38 +0200
committerJose <jose@zeroc.com>2014-05-02 19:56:38 +0200
commit1161c5817059464ab511632c0ce5d14593ced1a3 (patch)
tree51bbcdf2a4ea43c430312157350bb4271bc3f40d /cpp/src/Freeze/MapDb.cpp
parentUpdate .gitignore files (diff)
downloadice-1161c5817059464ab511632c0ce5d14593ced1a3.tar.bz2
ice-1161c5817059464ab511632c0ce5d14593ced1a3.tar.xz
ice-1161c5817059464ab511632c0ce5d14593ced1a3.zip
ICE-4851 - Use wstrings for input and output data that contain non-ASCII characters?
Diffstat (limited to 'cpp/src/Freeze/MapDb.cpp')
-rw-r--r--cpp/src/Freeze/MapDb.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/cpp/src/Freeze/MapDb.cpp b/cpp/src/Freeze/MapDb.cpp
index 48ccb6ec75b..cb06a456596 100644
--- a/cpp/src/Freeze/MapDb.cpp
+++ b/cpp/src/Freeze/MapDb.cpp
@@ -14,10 +14,11 @@
#include <Freeze/CatalogIndexList.h>
#include <algorithm>
-#include <Ice/StringConverter.h>
+#include <IceUtil/StringConverter.h>
using namespace std;
using namespace Ice;
+using namespace IceUtil;
using namespace Freeze;
namespace
@@ -184,8 +185,11 @@ Freeze::MapDb::MapDb(const ConnectionIPtr& connection,
flags |= DB_CREATE;
}
- open(txn, Ice::nativeToUTF8(_communicator, _dbName).c_str(), 0, DB_BTREE, flags, FREEZE_DB_MODE);
-
+ //
+ // Berkeley DB expects file paths to be UTF8 encoded.
+ //
+ open(txn, nativeToUTF8(getProcessStringConverter(), _dbName).c_str(), 0, DB_BTREE,
+ flags, FREEZE_DB_MODE);
StringSeq oldIndices;
StringSeq newIndices;
@@ -435,7 +439,11 @@ Freeze::MapDb::MapDb(const Ice::CommunicatorPtr& communicator,
u_int32_t flags = DB_THREAD | DB_CREATE | DB_AUTO_COMMIT;
- open(0, Ice::nativeToUTF8(_communicator, _dbName).c_str(), 0, DB_BTREE, flags, FREEZE_DB_MODE);
+ //
+ // Berkeley DB expects file paths to be UTF8 encoded.
+ //
+ open(0, nativeToUTF8(getProcessStringConverter(), _dbName).c_str(), 0, DB_BTREE, flags,
+ FREEZE_DB_MODE);
}
catch(const ::DbException& dx)
{