English 中文(简体)
C++ Base64 encoding - PHP兼容
原标题:C++ base64 encoding - PHP compatible

我有一台台式机,向一个网络服务器提供约2-3克双元数据。 我用<代码>制定了张贴单。 HttpSendRequest, 后者与案文相去甚远,但显然与本书不符。 从我的研究来看,我想到的是base64。 在校正我的++版图中的数据,然后使用<编码>base64_decode in PHP储存这一数据。

我下载了数份c/c++文档,目的是在<条码>64<><>><>> >上编码,但要么只是不做笔工作,要么是符合PHP编码的编码。

我的问题是:

  1. Am I going about this the right way? Is there a better format to transport this data?
  2. Is anyone aware of a simple class or other c++ code that can help me encode this data in the proper format?

———————— 过去,我一直在这样做,现在比以往更加混淆不清。 这里的数据:

  1. Original binary data: http://pastebin.com/cPWjGN3q
  2. After base64 encoding in C++: http://pastebin.com/H4Jze96g
  3. Uploaded as encoded in php: http://pastebin.com/MRLZrsve
  4. Decoded in php: http://pastebin.com/TJs5WCNj
  5. The code I m using to POST the data: http://pastebin.com/L856rKmw.

我不 sure不 sure,但任何使这一 straight人伸出的协助,将受到大为的 appreciated。

-- UPDATE 2 -- The POST process changes the + characters in the encoded data to spaces. See the following:

C++的数据:

As copied via FTP to server: http://pastebin.com/S0qjfreM

Is there a logical reason why the post process would change this character? I would prefer to understand and resolve the actual problem, but perhaps performing a string replace would be sufficient to finally move past this problem?

问题回答

第64号基地是一个定义明确的编码机制,因此在执行之间没有不一致之处。 如果你用不同的执行方法重新看到一贯的失败,那么问题就在于编码算法以外的其他地方。

你们可以通过简单地将产出倾销到档案中来加以检验。

事实上,尽管编码方法相对健全,但某些特征可能具有特殊意义,取决于其出现的背景(URL, POST, Html)。 除此以外,“吉大港”和“大部分”客户实施不同的转让和内容编码可能会造成更多的混乱。

如果我们看到你用什么代码来预选数据并援引HttpSendrequest的话,这可能会有所帮助。





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签