flutter - 如何在 Flutter 或 Dart 中将字符串编码为 RFC 3986?
问题描述
我正在尝试将字符串编码为 RFC 3986。我找到了 Uri.encodeComponent 方法,但它将字符串编码为 RFC 2396。基本上,我正在寻找 PHP 中的方法的替代方法,即 rawurlencode。在 php 中,此方法将字符串编码为 RFC 3986。在 Dart 或 Flutter 中有没有这样的方法?
解决方案
所以我从 Dart SDK gitter Channel 找到了答案。使用 Uri.encodeQueryComponent 它与 encodeComponent 相同,但不是使用 RFC 2396 兼容表,而是使用 RFC 3986。
推荐阅读
- android - 从源代码构建自己的 LineageOS 生成错误
- php - 购物车仍然显示已删除的产品 Laravel
- javascript - 在 Nativescript 中实现原生 android .aar 文件或 .aidl 会抛出原生 calss 对象而无法访问方法
- google-cloud-platform - google cloud sql v1beta4 是否仍处于测试阶段?
- c# - 在 c# 中隐藏代理生成的某些属性
- html - 如何减小 Photoshop 呈现的 HTML 电子邮件签名的大小?
- node.js - 防止不安全的重定向
- html - 具有相同高度的 CSS Flex-Box
- vue.js - 放大页面加载时不支持的 vue2-google-maps
- php - PHP/Postman - 如何填充 $Get