`

base64encode的一个问题

 
阅读更多

之前写程序把base64encode的数据提交到服务器,服务器端出现数据的+号被替换为空格的情况。

查了w3规范手册,原因是如下的编码规范中说的,所以服务器会在解码时把+号改为空格然后给到业务。

所以最好再做个urlencode/urldecode

 

参考:http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1

 

application/x-www-form-urlencoded  

This is the default content type. Forms submitted with this content type must be encoded as follows:

  1. Control names and values are escaped. Space characters are replaced by `+', and then reserved characters are escaped as described in [RFC1738], section 2.2: Non-alphanumeric characters are replaced by `%HH', a percent sign and two hexadecimal digits representing the ASCII code of the character. Line breaks are represented as "CR LF" pairs (i.e., `%0D%0A').
  2. The control names/values are listed in the order they appear in the document. The name is separated from the value by `=' and name/value pairs are separated from each other by `&'.
分享到:
评论

相关推荐

    JS 版本的base64函数实现(base64encode,base64decode)

    用js实现的base64encode,base64decode函数. 包括: function base64encode(str) { function base64decode(str) { function utf16to8(str) { function utf8to16(str) { function doit() {

    base64encode.js

    base64编码解码工具,方便日常中JS开发.

    base64 encode 中文版

    这是rfc2045里面的base64encode标准的中文译码

    JavaScript版的PHP函数base64_encode与base64_decode

    用JavaScript实现PHP里的Base64编码与解码。 使用方法: encode64('要编码的字符串'); decode64('要解码的字符串');

    易语言汇编base64编码

    易语言汇编base64编码源码,汇编base64编码,Base64Encode,Base64Decode

    Base64 Encode编码实现1x1px透明(黑白)图片

    我们都知道图片有一个base64编码,可以将你的图标变成代码的方式 现在的无线淘宝应用往往都是采用这种方式 今天特意将一个小的透明的图片压缩后代码提供给大家使用 使用方法: 附件中图片src指向的代码直接...

    Base64Encode for delphi

    Base64Encode for delphi , Base64Encode for delphi

    delphi2010 base64_encode&decode

    支持多种字符集,解决中文加密后解密乱码的问题

    BASE64Encode编码,jar包(源代码打包)

    BASE64Encode 编码,在andorid没有这个编码,这里面有打成jar包,可以导进去。用源代码打包的。手懒不愿意自己弄得话,可以下载导进去。里面附带着源代码,也可将源代码开进去直接使用,希望能帮助大家。

    base64encode:Base64字符串编码模块

    这是一个[Node.js]( )模块,可从[npm Registry]( )获得。 $ npm install base64encode1 --save const base64encode = require ( 'base64encode1' ) ; const text = "Hello World !" ; console . log ( base64...

    base64_encode and urlencode

    base64_encode urlencode 源码,可以根据需求稍作修改便能实现功能

    Base64.dll(Base64编解码,附VB示例)

    内附一个比较三方提供的比较经典的库VBVorLib,其性能也相当不错。本程序库比之稍快,内附截图。 Public Declare Sub Encode Lib "Base64" (ByRef Dest() As Byte, ByRef Src() As Byte) Public Declare Sub ...

    2进制与base64编码转换C代码

    需要一个二进制与BASE64相互转换的函数,从网上找了几个,或者是错的,或者不输出长度,待转的二进制串中有可能出现00截断,因此不能直接以strlen来计算长度,所以我引用网上的一个可用代码后加以修改,变成现在的...

    Base64 编码 解码 java 源代码

    Base64 编码 解码 java 源代码 encode decode

    转encode64(base64)base64.js

    base64.js转encode64(base64),文章对应同名。针对于富文本带标签操作或者带;传输失败问题。

    Delphi BASE64

    Function Base64Encode(InputData: String; Var OutputData: String): byte; {* 对数据进行BASE64编码,如编码成功返回Base64_OK | InputData:string - 要编码的数据 var OutputData: string - 编码后的数据 |...

    Base64_base64_zip_

    C++ base64 base64Encode base64Decode

    android需要的BASE64Encoder的jar包

    啥都不说了,CSDN都要30多分,抢钱啊,我着急下载,没有那么多分,对那些...android需要的BASE64Encoder的jar包,欢迎大家下载使用,为什么要5分,是因为,为了下载这么个破jar包,我花干了我的分,也是为了凑够字数。

    base64encode封装加密解密

    很好用的,封装加密解密,用得到的大家可以下载,

    易语言Base64编解码新汇编

    易语言Base64编解码新汇编源码,Base64编解码新汇编,P_Bin,P_Str,Base64编码,Base64Encode,Base64解码,Base64Decode

Global site tag (gtag.js) - Google Analytics