diff --git a/src/elements/customstyle.rs b/src/elements/customstyle.rs
index 5c3e67a..098219a 100644
--- a/src/elements/customstyle.rs
+++ b/src/elements/customstyle.rs
@@ -130,7 +130,7 @@ impl RuleState for CustomStyleState {
 				.map(|last| {
 					(
 						last.location().source(),
-						last.location().end() - 1..last.location().end(),
+						last.location().end_offset(1)..last.location().end(),
 					)
 				})
 				.unwrap();
diff --git a/src/lsp/semantic.rs b/src/lsp/semantic.rs
index 82ffad6..de93d07 100644
--- a/src/lsp/semantic.rs
+++ b/src/lsp/semantic.rs
@@ -407,7 +407,7 @@ impl<'a> Semantics<'a> {
 			let len = usize::min(range.end - cursor.pos, end);
 			let clen = self.source.content()[cursor.pos..cursor.pos + len]
 				.chars()
-				.fold(0, |acc, _| acc + 1);
+				.fold(0, |acc, c| acc + c.len_utf16());
 
 			let delta_line = cursor.line - current.line;
 			let delta_start = if delta_line == 0 {