Closed Tester-957 closed 2 months ago
I did this experiment on Mac and Windows. Mac had no problem writing a large html, but windows couldn't handle large html.
use clipboard_rs::{ClipboardContext, Clipboard};
fn main() {
let ctx = ClipboardContext::new().unwrap();
let html = std::fs::read_to_string("./text.html").unwrap();
println!("Length (original): {}", html.len());
ctx.set_html(html).unwrap();
let html = ctx.get_html().unwrap();
println!("Length: {}", html.len());
}
Length (original): 132205
Length: 205
Reading html on Windows works. Reading and writing on Ubuntu work.
fix in https://github.com/ChurchTao/clipboard-rs/pull/24 release soon.
@HuakunShen @Tester-957
@HuakunShen Platform: Windows 11 Version: 0.6.8
I added some code to the example for testing:
Read html and print the length into the htmlString variable
Write htmlString unchanged to clipboard and read clipboard html length again