encoding

MP3 coversion on Amazon's EC2

I run a small record label and we have a bunch of audio files stored on Amazon's S3. We want them converted to MP3's with a standard bitrate. I read about the NYTimes converting all their PDF's using EC2 and since I'm a nerdy web programmer, I'm intrigued. Instead of downloading all the files and converting them by hand, I'm wondering wh...

PHP: Detect encoding and make everything UTF-8

Hello! I'm reading out lots of texts from various RSS feeds and inserting them into my database. Of course, there are several different character encodings used in the feeds, e.g. UTF-8 and ISO-8859-1. Unfortunately, there are sometimes problems with the encodings of the texts. Example: 1) The "ß" in "Fußball" should look like this i...

character encoding in libc?

What is the character encoding expected in libc? For example, gethostname(char *name, size_t namelen); takes char* as argument. Is it expected that the name parameter be encoded in utf8(which keeps the ascii intact) or plain ascii or some other format? Also does C mandates any character encoding scheme? ...

searching unicode string

hi, I am working in a application that takes unicode string as a input. I successfully obtained the sets of words as a list. Now i need to search the input string in the given sets of string that are in the list. I tried to compare the given string with each string in the list but only gets the unrecognised characters as an output. I thi...

Is the XML declaration tag case sensitive?

I have what is probably a really simple, studid question but I can't find an answer to it anywhere and I need to be pretty sure about this. I have various XML files from various vendors. One of the vendors provide me an XML file with japanese characters in the file. Originally, I was having trouble processing the XML file (I'm using the...

Stop asp.net image control automatically UrlEncoding the ImageUrl parameter

By default the asp.net image control trys to be helpful and automatically encodes anything set to the ImageUrl property, so: imgSomething.ImageUrl = "Generator.aspx?x=1&y=2&z=3"; Becomes "Generator.aspx?x=1&y=2&z=3" The problem is I want to pass Base64 encoded parameters, which I need to manually Server.UrlEncode because ea...

How can I covert a binary file into a set of ascii charecters

I want to convert a binary file into an array of ascii charcters . how can I do that . thank you . ...

Why Encoding.Default.GetBytes() returns different results in VB.NET and C#?

We recently came across some sample code from a vendor for hashing a secret key for a web service call, their sample was in VB.NET which we converted to C#. This caused the hashing to produce different input. It turns out the way they were generating the key for the encryption was by converting a char array to a string and back to a by...

c# and Encoding.ASCII.GetString

byte[] header = new byte[]{255, 216}; string ascii = Encoding.ASCII.GetString(header); I expect ASCII to be equal to be FFD8 (JPEG SOI marker) Instead I get "????" ...

Encoding problems in JSP

I have an html-form with several text fields. When I try to submit not English characters (Russian in my case) server is received "unreadable" string (not questions - "???" but some strange characters). I simplified my code to show it here: <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ page contentType="text/...

Problem with word "Nestlé" in an XML doc (UTF-8 encoding) using NXXMLParser. Any idea?

Hi all, We are using NSXMLParser in Objective-C to parse our XML document, which are all UTF-8 encoded. One document has a string "Nestlé" in it (as in ...<title>Nestlé Novelties</title>...). The parser just quit, reporting an error with error code=9, due to the French letter "e" at the end of the word "Nestle". Furthermore, we tried us...

C# Method like Base64String, but only alphanumeric (no plus or slash)

Hello, is there any C# method that works similar to Convert.ToBase64String but doesn't generate anything except alphanumeric output? Thanks! ...

Which are the valid control characters in HTML/XHTML forms.

Hello, I'm tring to create form validation unit that, in addition to "regular" tests checks encoding as well. According to this article http://www.w3.org/International/questions/qa-forms-utf-8 the allowed characters are CR, LF and TAB in range of 0-31, the DEL=127 in not allowed. On the other hand, there are control characters in rang...

Python IRC bot and encoding issue

Currently I have a simple IRC bot written in python. Since I migrated it to python 3.0 which differentiates between bytes and unicode strings I started having encoding issues. Specifically, with others not sending UTF-8. Now, I could just tell everyone to send UTF-8 (which they should regardless) but an even better solution would be tr...

How can I find non ascii strings in an array of strings, in Rails 2.0/ruby 1.8.6?

I have an array full of user logins that was loaded from the database. What's the simplest and efficient way to keep only the logins that contain non-ascii characters? logins = Users.find(:all).map{|user|user.login} logins_with_non_ascii_characters = logins.select{ |login| ...??? } Thanks Edit: if you have a SQL solution (I use MySQ...

Equivalent Javascript Functions for Python's urllib.quote() and urllib.unquote()

Hello, Are there any equivalent Javascript functions for Python's urllib.quote() and urllib.unquote()? The closest I've come across are escape(), encodeURI(), and encodeURIComponent() (and their corresponding un-encoding functions), but they don't encode/decode the same set of special characters as far as I can tell. Thanks, Cameron ...

How can I process data to avoid MySQL "incorrect string value" error?

I am trying to use a Rake task to migrate some legacy data from MS Access to MySQL. I'm working on Windows XP, using Ruby 1.8.6. I have the encoding for Rails set as "utf8" in database.yml. Also, the default character set for MySQL is utf8. 99% of the data is coming in fine, but every now and then I'll get a column value that gives me...

How can I convert a string from windows-1252 to utf-8 in Ruby?

I'm migrating some data from MS Access 2003 to MySQL 5.0 using Ruby 1.8.6 on Windows XP (writing a Rake task to do this). Turns out the Windows string data is encoded as windows-1252 and Rails and MySQL are both assuming utf-8 input so some of the characters, such as apostrophes, are getting mangled. They wind up as "a"s with an accent ...

Flash -> ByteArray -> AMFPHP -> Invalid Image !??

Hi, Im loading images into Flash and using JPGEncoder to encode the image to a ByteArray and send this to AMF PHP which writes out the bytearray to a file. This all appears to work correctly and I can download the resulting file in Photoshop CS4 absolutely fine. When i try to open it from the desktop or open it back in Flash it doesnt w...

Java Servlet: How to handle unknown encodings?

When a certain user tries to view our web page, a NullPointerException with the message 'charsetName' is thrown when we call response.getWriter(). I decompiled our web server's response class (JRun 3.1) and found that this error is being thrown when it does this: s = getCharacterEncoding(); // returns 'x-mac-roman' I believe try { ...