encoding

What character replacements should be performed to make base 64 encoding URL safe?

In looking at URL safe base 64 encoding, I've found it to be a very non-standard thing. Despite the copious number of built in functions that PHP has, there isn't one for URL safe base 64 encoding. On the manual page for [base64_encode()][1], most of the comments suggest using that function, wrapped with strtr(): function base64_url_e...

NSData to NString conversion problem

I'm getting an HTML file as NSData and need to extract some parts of it. For that I need to convert it to NSString with UTF8 encoding. The thing is that this conversion fails, probably because the NSData contains bytes that are invalid for UTF8. I have tried to get the byte array of the data and go over it, but each time I come across no...

convert the key in MIME encoded form in python

this is the code : f = urllib.urlopen('http://pool.sks-keyservers.net:11371/pks/lookup?op=get&search= 0x58e9390daf8c5bf3') #Retrieve the public key from PKS data = f.read() decoded_bytes = base64.b64decode(data) print decoded_bytes i need to convert the key in MIME encoded form which is presently comes in (ascii armored) radix 64...

In C# String/Character Encoding what is the difference between GetBytes(), GetString() and Convert()?

We are having trouble getting a Unicode string to convert to a UTF-8 string to send over the wire: // Start with our unicode string. string unicode = "Convert: \u10A0"; // Get an array of bytes representing the unicode string, two for each character. byte[] source = Encoding.Unicode.GetBytes(unicode); // Convert the Unicode bytes to U...

Creating a sample mp3 with fade

I need to know if it is possible to create a 30 second sample MP3 from a WAV file. The generated MP3 file must feature a fade at the start and end. Currently using ffmpeg, but can not find any documentation that would support being able to do such a thing. Could someone please provide me the name of software (CLI, *nix only) that could...

Batch file encoding

I would like to deal with filename containing strange characters, like french é. Everything is working fine in the shell : C:\somedir\>ren -hélice hélice Know if I put this line in a .bat file, I obtain the following result : C:\somedir\>ren -hÚlice hÚlice See ? é have been replaced by Ú The same is true for command output. If I ...

encoding camera with audio source in realtime with WMAsfWriter - jitter problem

Hello I build a DirectShow graph consisting of my video capture filter (grabbing the screen), default audio input filter both connected through spliiter to WM Asf Writter output filter and to VMR9 renderer. This means I want to have realtime audio/video encoding to disk together with preview. The problem is that no matter what WM profil...

C# .Net 2.0 My Encoding works on Windows XP and Vista but not Windows 7

I have a .Net 2.0 app that uses UnicodeEncoding.Unicode when saving to a file when the data contains foreign characters this works fine on Windows XP and Vista but not on Windows 7, on Windows 7 I get a question marks ???? in the file (text file) instead of the correct characters. Any ideas where I should look? Thanks ...

Convert Latin 1 encoded UTF8 to Unicode

I came upon trying to convert a database that is encoded in UTF8 from what it looks like, into a windows 1251 encoding (dont ask, but I need to do this). All of the Russian, encoded characters in the db show up as абвгдÐ. When I pull them out of the db into my C# app, into strings, I still see абвгдÐ. No matter what I try to do...

enabling UTF-8 encoding for clojure source files.

Hi all, I'm working on a project which involves maven, java and clojure. The problem I'm facing is this, I have some UTF-8 chars in my clojure source files because of which my source code is not interpreted correctly by the java compiler, I kinda got it working by setting the environment variable JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF...

How to read an ANSI encoded file containing special characters

Hello folk, I'm writing a TFS Checkin policy, which checks if our source files containing our file header. My problem is, that our file header contains a special character "©" and unfortunately some of our source files are encoded in ANSI. So if I read these files in the policy, the string looks like this "Copyright � 2009". string co...

R character encodings across windows, mac and linux

I use OS X and I am currently cooperating with a windows user and deploying the scripts on a linux server. We use git for version control, and I keep getting R scripts from his end where the character encoding used has mixed latin1 and utf8 encodings. So I have a couple of questions. Is there a simple to use editor for windows that h...

Encoding problems in PyQt

My program stores file index in file packed by cPickle. There are non-english filenames. When I just do this print f [0] where f [0] is "\xc2\xe8\xf1\xee\xea\xee\xf1\xed\xfb\xe9 \xe3\xee\xe4" ("Високосный год" in normal view), it prints the string in proper way — in russian. When the program manually adds the string u'Високосный год'...

decodeURIComponent for postgres

I use decodeURIComponent and encodeURIComponent in Javascript. Before I store this data in a UTF-8-PostgreSQL-Database, I should decode them: $my_data = pg_escape_string(utf8_encode($_POST['my_data'])); I'm looking for a PostgreSQL-Function to convert Javascript-Encoded Data. ...

Excel to XML, encoding question

This is all mixed up in my head, and I can't wrap my head around it. I have an excel file I have to parse, using Java, and translate to XML. Using the jExcel library, I can achieve the parsing, and the application's doing the right work, and putting the right strings in the right place. So for the parsing part, I've got that covered. P...

Why is this A0 character appearing in my HTML::Element output?

I'm parsing an HTML document with a couple Perl modules: HTML::TreeBuilder and HTML::Element. For some reason whenever the content of a tag is just  , which is to be expected, it gets returned by HTML::Element as a strange character I've never seen before: I can't copy the character so can't Google it, couldn't find it in charact...

emacs output buffer coding system?

Hi, I have in one of my directories an elisp file which I use to get a list of files: ((lambda () (let ((coding-system-for-write 'utf-8-emacs) (get-these-files '("FILE1" "FILE2"))) (cmd "scp user@remotehost:pathtofiles/ .&")) (mapcar (lambda (x) (shell-command (format cmd x))) get-these-files)))) [I use a lambd...

encode xml while printing SOAPMessage

Hi, I have written a function to pretty print a javax.xml.soap.SOAPMessage to a string: public static String soapMessageToString (SOAPMessage msg) { try { Writer out = new StringWriter(); TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = t...

How to send mail with binary word in mail subject using PHP

I am going to send mail through PHP website. Client may custom the mail subject and I will get the post data in UTF-8. But When I send out a html mail using the php mail(), I found the the mail subject cannot show properly while the mail body does. How to send chinese word in PHP mail function? Thanks. ...

Is iso-8859-1 supported in Silverlight?

Hi, this is a simple question: does Silverlight (3.0?) support this kind of encoding? Encoding c = Encoding.GetEncoding("iso-8859-1"); Calling this function in Silverlight 3.0 generate the following error. 'ISO-8859-1' is not a supported encoding name. Parameter name: name My idea is to parse some file client side and then uplo...