Skip to content

Commit 76766f5

Browse files
committed
get_equivalent_unit_range
1 parent e74305d commit 76766f5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lua/fittencode/base/fn.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ end
228228
---@param index? integer
229229
---@return integer[]
230230
function M.utf_to_byteindex(layout, encoding, index)
231-
return M.conv_codeunit(layout, encoding, 'utf-8', index)
231+
return M.get_equivalent_unit_range(layout, encoding, 'utf-8', index)
232232
end
233233

234234
-- 给定 UTF-8 字符串 s,目标编码 encoding,以及在 UTF-8 编码中字节位置
@@ -240,10 +240,10 @@ end
240240
---@param index? integer
241241
---@return integer[]
242242
function M.byte_to_utfindex(layout, encoding, index)
243-
return M.conv_codeunit(layout, 'utf-8', encoding, index)
243+
return M.get_equivalent_unit_range(layout, 'utf-8', encoding, index)
244244
end
245245

246-
function M.conv_codeunit(layout, from_encoding, to_encoding, index)
246+
function M.get_equivalent_unit_range(layout, from_encoding, to_encoding, index)
247247
local from_cumulative_units = layout.cumulative_units[from_encoding]
248248
local to_cumulative_units = layout.cumulative_units[to_encoding]
249249

0 commit comments

Comments
 (0)