encoding

FFMPEG - format not available?

时光毁灭记忆、已成空白 提交于 2019-12-23 20:33:20
问题 I'm converting some code from FFMPEG 0.8 to FFMPEG 1.2. I have an error during the call to the method avcodec_open2(): " Specified pixel format %s is invalid or not supported ". The format I use is : AV_PIX_FMT_RGB24. It should be enabled by default, right? Below is my code: av_register_all(); codec = avcodec_find_encoder(AV_CODEC_ID_MPEG2VIDEO); if(!codec) { throw SystemException("codec not found"); } codecContext = avcodec_alloc_context3(codec); codecContext->bit_rate = 200000; codecContext

What type of encoding is this? I am told it's Bencode, but it doesn't look standard [closed]

杀马特。学长 韩版系。学妹 提交于 2019-12-23 20:14:40
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 7 years ago . I'm working on a project in which they have stored the following type of encoded data in a BLOB type column of a mysql database. I've asked around and

Decoding an UTF-8 string to Windows-1256

試著忘記壹切 提交于 2019-12-23 19:45:48
问题 I used this code to encode a UTF-8 string to Windows-1256 string: string q = textBox1.Text; UTF7Encoding utf = new UTF7Encoding(); byte[] winByte = Encoding.GetEncoding(1256).GetBytes(q); string result = utf.GetString(winByte); This code is working but I can't decode the result or encoded to original string! How I can decode an encoded string (result variable) to same before converted (q variable)? 回答1: You are converting the strings incorrectly. Have a look at the commented code below. The

Save Word to UTF-8 Encoded HTML

痞子三分冷 提交于 2019-12-23 19:43:13
问题 I am writing some C# VSTO code that reads a Microsoft Word document and saves it to Filtered HTML. When I perform this function on a generic Word document, the output of the html file uses a Windows Charset as witnessed here: <meta http-equiv=Content-Type content="text/html; charset=windows-1252"> If I open a document and go to File->Options->Advanced->Web Options, I can choose UTF8, and the resulting filtered html document output looks like this: <meta http-equiv=Content-Type content="text

R print UTF-8 code in data.frames on Windows platform Rstudio

时间秒杀一切 提交于 2019-12-23 19:27:01
问题 When there are UTF-8 characters in the data frame, it won't be displayed properly. For example, the following is correct: > "\U6731" [1] "朱" But when I put that in a data frame and have it printed, here it is: > data.frame(x="\U6731") x 1 <U+6731> Hence I believe this has nothing to do with encoding issues. Is there any direct way to print 朱 instead of <U+6731> . I have to use Windows in company so using Linux might not be feasible for me. 回答1: The corpus library has a work-around for this

How to use C# encode and decode 'Chinese' characters

梦想的初衷 提交于 2019-12-23 18:44:42
问题 In my ASP.NET MVC application i am using Chinese Category Name, it was displayed as %E8%82%B2%E5%84%BF in IE's URL address, but the actual value is '育儿'. I want to know how can I convert '育儿' into %E8%82%B2%E5%84%BF in C# and how can I convert it back, too. Is it possible display '育儿' in the URL link directly? Will it be good for SEO? 回答1: The text displayed in IE's address bar is the URL encoded form of the hex version of those characters. The hex version of '育儿' encoded in UTF-8 is

Unicode encoding/decoding

跟風遠走 提交于 2019-12-23 18:10:08
问题 I have a string that looks like this. st = '/M\xe4rzen' I would like to covert this to unicode. How can I do this? I've tried: st.decode('utf-8') unicode(t, 'utf-8') The original file is utf-8 encoded, but I can't seem to get the unicode representation of the string. 回答1: Your data is not UTF8 encoded; more likely it is using the Latin-1 encoding: >>> print st.decode('latin1') /Märzen Calling .decode() is enough, no need to also call unicode() . 来源: https://stackoverflow.com/questions

Using hebrew on python

为君一笑 提交于 2019-12-23 17:55:28
问题 I have a problem printing hebrew words. i am using the counter module in order to count number of words in my given text (which is in hebrew). the counter indeed counts the words, and identifies the language because i am using # -*- coding: utf-8 -*- The problem is, when i print my counter, i get weird symbols. (I am using eclipse) Here is the code and the printings: # -*- coding: utf-8 -*- import string from collections import Counter class classifier: def __init__(self,filename): self

JavaMail base64 encoding

你。 提交于 2019-12-23 17:48:01
问题 I have some Java code which sends out an email with code somewhat like the following: MimeBodyPart part = new MimeBodyPart(); part.setContent(htmlString, "text/html; charset=\"UTF-8\""); part.setHeader("MIME-Version", "1.0"); part.setHeader("Content-Type", "text/html; charset=\"UTF-8\""); part.setHeader("Importance", severityVal); mimeMultiPart.addBodyPart(htmlPart); mimeMessage.setContent(mimeMultiPart); ... and so on. How can I encode the "part" MimeBodyPart in base64 for this outgoing

Angular translate: placeholder not showing special characters correctly

五迷三道 提交于 2019-12-23 17:21:38
问题 I am currently using angular-translate for a project, and it's going really well. However I run into a problem and I can't see why it's not working. I have an input field with a placeholder text, which has to be translated. This works fine, except when the translation-text includes special characters such as øæåüöä and so on. This is my code: <input type="text" ng-model="search.query" autofocus translate-attr-placeholder="SEARCHPLACEHOLDER" translate /> <div translate>SEARCHPLACEHOLDER</div>