safeEncodeURIComponent

编码 URL 组件(安全版本)

用法

safeEncodeURIComponent 函数用于编码 URL 组件(安全版本)。

import { safeEncodeURIComponent } from '@movk/core'

safeEncodeURIComponent('中文') // '%E4%B8%AD%E6%96%87'
safeEncodeURIComponent('hello world') // 'hello%20world'

API

safeEncodeURIComponent(str)

编码 URL 组件(安全版本)。

参数

str
string required
要编码的字符串。

返回值

返回值
string
编码后的字符串。

Changelog

7c832 — refactor!: 重构模块架构,拆分 utils 为专业化模块

Copyright © 2024 - 2026 YiXuan - MIT License