decoding

How to properly decode accented characters for display

你。 提交于 2019-12-12 12:23:38
问题 My raw input file text file contains a string: Caf&eacute (Should be Café) The text file is a UTF8 file. The output lets say is to another text file, so its not necessarily for a web page. What C# method(s) can i use to output the correct format, Café ? Apparently a common problem? 回答1: Have you tried System.Web.HttpUtility.HtmlDecode("Café") ? it returns 538M results 回答2: This is HTML encoded text. You need to decode it: string decoded = HttpUtility.HtmlDecode(text); UPDATE: french symbol "é

How to decode q-encoding in C?

倖福魔咒の 提交于 2019-12-12 11:31:38
问题 Is there any library for q-encoding? I need to decode some q-encoded text, such as: **Subject: =?iso-8859-1?Q?=A1Hola,_se=F1or!?=** 回答1: GNU Mailutils libmailutils is one example of such library. "Q"-encoding is specified by RFC 2047 so using it as a search term gives you other relevant results. 回答2: Email subject is encoded according to RFC 2047. We can decode it by using function mu_rfc2047_decode() provided by GNU mailutils. Example: #include <stdio.h> #include <stdlib.h> #include

Base64 encoding issue in Python

爱⌒轻易说出口 提交于 2019-12-12 10:08:42
问题 I need to save a params file in python and this params file contains some parameters that I won't leave on plain text, so I codify the entire file to base64 (I know that this isn't the most secure encoding of the world but it works for the kind of data that I need to use). With the encoding, everything works well. I encode the content of my file (a simply txt with a proper extension) and save the file. The problem comes with the decode. I print the text coded before save the file and the text

Decode a websocket frame

牧云@^-^@ 提交于 2019-12-12 08:06:23
问题 I am trying to decode a websocket frame, but I'm not successful when it comes to decoding the extended payload. Here what I did achieve so far: char *in = data; char *buffer; unsigned int i; unsigned char mask[4]; unsigned int packet_length = 0; int rc; /* Expect a finished text frame. */ assert(in[0] == '\x81'); packet_length = ((unsigned char) in[1]) & 0x7f; mask[0] = in[2]; mask[1] = in[3]; mask[2] = in[4]; mask[3] = in[5]; if (packet_length <= 125) { **// This decoding works** /* Unmask

Android - SkImageDecoder::Factory only when i read image with extension .png

自古美人都是妖i 提交于 2019-12-12 06:13:46
问题 In my Android app i have to read a lot of images, for this reason i have implemented image caching. This is the method through which i decode my images(that were stored in the assets/ folder): private Bitmap getBitmapFromAsset(String strName) { AssetManager assetManager = context.getAssets(); InputStream istr = null; try { istr = assetManager.open(strName); } catch (IOException e) { e.printStackTrace(); } return decodeFileFromAssets(istr); } private Bitmap decodeFileFromAssets(InputStream

decode mysqlbinlog in C#

不想你离开。 提交于 2019-12-12 06:07:06
问题 MySQL saves all changes to the database in a binary file called binary log. MySQL provides a decoder called mysqlbinlog to decode these files. I thought if I wanted to parse this log file directly from an application then I need to find a way to decode it myself using C# for instance. I know if I had the privilege I could use SHOW BINLOG EVENTS. However, parsing the file would be a better solution for me. Has any of you done that before? Any suggestions? 回答1: A look into the mysqlbinlog-tool

Decode Array (unit8_t array to char array)

泪湿孤枕 提交于 2019-12-12 05:51:32
问题 I have a text representation of a encrypted buffer (via gcrypt) as follows: (enc-val (ecdh (s #04FA304FE9E91BED21E3C5898796056CE4E590E12BC74D0219A185D2E0B9B49A7393F023415F3E1FFD22D5B0A134E03F84D5C5DF7C5326C51971CFB783A26F1636#) (e #0411C41FC2ECB6F6F482050C005B30F75E134FD8AEA1E45F687A9E995CCFFB14DDD8EA41462E41CAEBA2AA21CA8F70C67FF4AA6620E64BABA23CCA0088F292256D#) ) ) I then convert this text string to a ( uint_8 ) value array via the function data_from_string . The function is as follows: size

Spring PasswordEncoder decoding in external application

橙三吉。 提交于 2019-12-12 04:19:26
问题 I need to decode a password that was encoded using the org.springframework.security.authentication.encoding.PasswordEncoder.encodePassword method. Basically, application "A" maintains the encoded/encrypted password in its database. Application "B" makes a RESTful call to application "A" to get the userid and password (passes password as encoded/encrypted) and then application "B" needs to view the clear text version of the password, how would it decode it? 回答1: The mentioned class "org

AES decrypt in php

别说谁变了你拦得住时间么 提交于 2019-12-12 02:54:20
问题 I am new to AES but from what I have found there are several modes (ECB,CBC, etc.) and different modes need different initialization vector requirements, blocks, and encodings. I am trying to decode the following Xrb9YtT7cHUdpHYIvEWeJIAbkxWUtCNcjdzOMgyxJzU/vW9xHivdEDFKeszC93B6MMkhctR35e+YkmYI5ejMf5ofNxaiQcZbf3OBBsngfWUZxfvnrE2u1lD5+R6cn88vk4+mwEs3WoAht1CAkjr7P+fRIaCTckWLaF9ZAgo1/rvYA8EGDc+uXgWv9KvYpDDsCd1JStrD96IACN3DNuO28lVOsKrhcEWhDjAx+yh72wM= using php and the (text) key

decoding problem uiwebview

扶醉桌前 提交于 2019-12-12 01:16:13
问题 i am using uiwebview in my application. there are some links when user clicks a http search starts. it works fine but i have problems while getting "%58 den ysnky'ye tepki" it is given as "X'den ysnky'ye tepki". it has problems with % char. identifier:%58'den%20ysnky'ye%20tepki decoded identifier:X'den ysnky'ye tepki i am using stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding to decode the string like that; NSLog(@"identifier:%@", identifier); identifier = [identifier