decode

Decoding %E9 to utf8 fails

别来无恙 提交于 2019-12-23 12:15:13
问题 I'm having some trouble decoding some encoding char. What i need to decode is the %E9, i have a string like this D%E9bardeur and degr%E9 What i do in my java class, is the following: try { System.out.println(o);// test o = URLDecoder.decode((String) o, "UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } After this operation, what i get is D�bardeur and degr� The very same happens when i dont decode to utf-8 Any advice? thx 回答1: %E9 is not UTF-8. The correct way to

C++: Convert hex representation of UTF16 char into decimal (like python's int(hex_data, 16))

房东的猫 提交于 2019-12-23 05:50:24
问题 I found an explanation to decode hex-representations into decimal but only by using Qt: How to get decimal value of a unicode character in c++ As I am not using Qt and cout << (int)c does not work (Edit: it actually does work if you use it properly..!) : How to do the following: I got the hex representation of two chars which were transmitted over some socket (Just figured out how to get the hex repr finally!..) and both combined yield following utf16-representation : char c = u"\0b7f" This

Invalid length for a Base-64 char array exception

六眼飞鱼酱① 提交于 2019-12-23 04:34:21
问题 i have exception when i run this code ,, what is wrong var encoder = new System.Text.UTF8Encoding(); System.Text.Decoder utf8Decode = encoder.GetDecoder(); byte[] todecodeByte = Convert.FromBase64String(encodedMsg); int charCount = utf8Decode.GetCharCount(todecodeByte, 0, todecodeByte.Length); var decodedChar = new char[charCount]; utf8Decode.GetChars(todecodeByte, 0, todecodeByte.Length, decodedChar, 0); var message = new String(decodedChar); exception occurs in this line byte[] todecodeByte

Invalid length for a Base-64 char array exception

情到浓时终转凉″ 提交于 2019-12-23 04:34:17
问题 i have exception when i run this code ,, what is wrong var encoder = new System.Text.UTF8Encoding(); System.Text.Decoder utf8Decode = encoder.GetDecoder(); byte[] todecodeByte = Convert.FromBase64String(encodedMsg); int charCount = utf8Decode.GetCharCount(todecodeByte, 0, todecodeByte.Length); var decodedChar = new char[charCount]; utf8Decode.GetChars(todecodeByte, 0, todecodeByte.Length, decodedChar, 0); var message = new String(decodedChar); exception occurs in this line byte[] todecodeByte

C# with ZXing.Net: Decoding the QR code

谁说胖子不能爱 提交于 2019-12-23 04:25:03
问题 I'm new to C# and got problem with QR code decoding using ZXing.Net . The application launches with no errors, but I get nothing in the result string. I think the problem could be in RGBLuminanceSource() . private static byte[] ToByteArray(Image img) { byte[] byteArray = new byte[0]; using (MemoryStream stream = new MemoryStream()) { img.Save(stream, System.Drawing.Imaging.ImageFormat.Bmp); stream.Close(); byteArray = stream.ToArray(); } return byteArray; } private void button1_Click(object

Fiddler encodes decoded response. How can I do the same in vb.net?

早过忘川 提交于 2019-12-22 17:39:01
问题 I am using httpwebrequest to get a response from a website. In this response I should see an xml. But in my response it just shows me jibberish. I used fiddler to see what I get. I get an encoded response, which I manually need to decode to see the contents(this is in fiddler). How can I do the same thing in vb.net ? edit The response comes back as https . I have tried: HttpUtility.HtmlDecode(myResult,myStreamwriter) Dim request As HttpWebRequest = DirectCast(WebRequest.Create("www.url.com/

PHP: Help decoding malicious code [closed]

二次信任 提交于 2019-12-22 10:17:56
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . eval(gzuncompress(base64_decode('eF5Tcffxd3L0CY5WjzcyNDG2NDc3MLGMV4+1dSwqSqzU0LQGAJCPCMM='))); eval(gzuncompress(base64_decode('eF5LK81LLsnMz1OINzczNTK1MDUy01DJ1KxWSbR1LCpKrNTQtC5KLSktylNISixONTOJT0lNzk9J1VBJjFbJjNW0rgUAqDUUxQ=='))); eval(gzuncompress(base64_decode(

Encode Decode of strings python

非 Y 不嫁゛ 提交于 2019-12-22 05:02:18
问题 I have a list of html pages which may contain certain encoded characters. Some examples are as below - <a href="mailto:lad%20at%20maestro%20dot%20com"> <em>ada@graphics.maestro.com</em> <em>mel@graphics.maestro.com</em> I would like to decode (escape, I'm unsure of the current terminology) these strings to - <a href="mailto:lad at maestro dot com"> <em>ada@graphics.maestro.com</em> <em>mel@graphics.maestro.com</em> Note, the HTML pages are in a string format. Also, I DO NOT want to use any

ANdroid - Run APK file after edited using apktool get error : [INSTALL_PARSE_FAILED_NO_CERTIFICATES]

吃可爱长大的小学妹 提交于 2019-12-22 04:06:12
问题 I have an APK file name : Splash.apk. First i decode it using apktool apk d Splash.apk Then i edit Manifest, XML. Finally I export project to APK file name : EditedSpash.apk. apk b Splash When i run EditedSpash.apk on emulator. I got error. Do you explain it for me ? adb install EditedSplash.apk Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES] 回答1: you should sign to apk before install. 1) keytool -genkey -keystore (name).keystore -validity 10000 -alias (name) 2)answer some question (ex:name,

rewrite and url decoding

霸气de小男生 提交于 2019-12-21 20:57:44
问题 It seems a site is linking to mine in a bad way. From google webmaster tools I see some 404 errors domain.com/file.php?id=1 (404) Not found (Date) This url works ok but because of browser page decoding, the real (404) url is domain.com/file.php%3Fid%3D1 (this is what my browser displays in the url input when I click on google url) My first try was RewriteRule ^(.*)\%3F(.*)$ $1?$2 [R=301, L] to change %3F to ' ? ' but it does not work. It is confusing what is real and what is en/decoded.