Skip to content

Commit 59434f9

Browse files
rajivshah3Oleksandr Anyshchenko
andauthored
Fix Windows UTF-8 build flag (tikv#623)
Co-authored-by: Oleksandr Anyshchenko <[email protected]>
1 parent cad6e50 commit 59434f9

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

librocksdb-sys/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ fn build_rocksdb() {
171171
config.define("_MBCS", None);
172172
config.define("WIN64", None);
173173
config.define("NOMINMAX", None);
174-
config.define("WITH_WINDOWS_UTF8_FILENAMES", "ON");
174+
config.define("ROCKSDB_WINDOWS_UTF8_FILENAMES", None);
175175

176176
if &target == "x86_64-pc-windows-gnu" {
177177
// Tell MinGW to create localtime_r wrapper of localtime_s function.

tests/test_db.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,23 @@ fn test_open_with_multiple_refs_as_single_threaded() {
618618
t.compile_fail("tests/fail/open_with_multiple_refs_as_single_threaded.rs");
619619
}
620620

621+
#[test]
622+
fn test_open_utf8_path() {
623+
let path = DBPath::new("_rust_rocksdb_utf8_path_temporärer_Ordner");
624+
625+
{
626+
let db = DB::open_default(&path).unwrap();
627+
628+
assert!(db.put(b"k1", b"v1111").is_ok());
629+
630+
let r: Result<Option<Vec<u8>>, Error> = db.get(b"k1");
631+
632+
assert_eq!(r.unwrap().unwrap(), b"v1111");
633+
assert!(db.delete(b"k1").is_ok());
634+
assert!(db.get(b"k1").unwrap().is_none());
635+
}
636+
}
637+
621638
#[test]
622639
fn compact_range_test() {
623640
let path = DBPath::new("_rust_rocksdb_compact_range_test");

0 commit comments

Comments
 (0)