encoding

Audio Encoding: AAC files without the 1/10 second silence at the end of the track

Hi, I'm a little confused with an issue that I keep running into. I'm trying to create some sound loops for continuously playing, seamless background music.. everything's fine as long as I stay in AAC/ WAV/ etc, but as soon as I encode the files in AAC I run into a 1/10 of a second at end of the sound file. I'm on the Mac, so I've trie...

Why is a SHA-1 Hash 40 characters long if it is only 160 bit ?

The title of the question says it all. I have been researching SHA-1 and most places I see it being 40 Hex Characters long which to me is 640bit. Could it not be represented just as well with only 10 hex characters 160bit = 20byte. And one hex character can represent 2 byte right? Why is it twice as long as it needs to be? What am I miss...

Define RSS feed encoding

I am trying to process RSS feed using Google Reader API, but the issue is that even if feed encoding is UTF-8 it is returned in an unreadable format. resp.contentType = "text/xml" resp.characterEncoding = "UTF-8" URL url = new URL("http://www.google.com/reader/public/atom/feed/" + rss); BufferedReader reader = new BufferedReader(new I...

insallation of ffmpeg and extensions problem

when I tried to install lamp I am getting this error in "make install" [dometome]$ make install Making install in mpglib make[1]: Entering directory `/home/username/ffmpeg/lame-3.97/mpglib' make[2]: Entering directory `/home/username/ffmpeg/lame-3.97/mpglib' make[2]: Nothing to be done for `install-exec-am'. make[2]: Nothing to be done ...

Javascript encoding decoding problem

I have the following javascript var cst = "\x26"; var other = $("#D1").html(); And my html has D1 div like the following <div id="D1">\x26</div> Now when I add a breakpoint and see my two variables cst and other. One is shown & and another \x26. Also cst.length == 1 but other.length == 4 I am confused. I need the...

Get encoding of a file in windows

This isn't really a programming question, is there a dos comment or windows tool (Windows 7). To get the current encoding of a text file? Sure I can write a little c# app but I wanted to know if there is something already built in? Thank you! ...

Encoding and decoding between Javascript and c#

I want to be able to send data to Javascript in a div like this: <div class="dontDisplay><%= myData %></div> However, the challenge is that the HTML will get messed up. There seems to be a plethora of encoding and decoding schemes out there, but I can't find a javascript/C# pair that are guaranteed to be compatible for all possible i...

How to handle user input of invalid UTF-8 characters?

I'm looking for general a strategy/advice on how to handle invalid UTF-8 input from users. Even though my webapp uses UTF-8, somehow some users enter invalid characters. This causes errors in PHP's json_encode() and overall seems like a bad idea to have around. W3C I18N FAQ: Multilingual Forms says "If non-UTF-8 data is received, an e...

Encoding issue: £ pound symbol appearing as <?> symbol

My database field is set to utf8_general_ci and my websites encoding is utf8. The £ symbol is coming up as a black diamond with a question mark through the center. I tried changing it to &pound; in the database and it just outputted I tried a string replace: $row['Information'] = str_replace("£", "&pound;", $row['Information']); ...

SQL Server & ASP .NET encoding issue

Hi, my page has utf-8 meta element added + sql server encoding is also utf. However when I create record and try to issue SELECT statement with condition that contains POLISH characters like 'ń' , I see no results. Any ideas what am I missing? ALSO Sql management studio shows result with POLISH characters , but I don't trust it.... I ...

HexDec to Char to Password Unencrypt in PHP

Ok, so I'm trying to figure out how to go from hexadecimal encryption to string and back, but for some reason the when I encrypt, i'm not getting the same password that was passed in, but its close...weird right? I'm sure my syntax is wrong somewhere. Help? Here's a link to test a little random password. I've set 'pw' as the hexadeci...

Is there any benefit to adding accept-charset="UTF-8" to HTML forms, if the page is already in UTF-8?

For pages already specified (either by HTTP header, or by meta tag), to have a Content-Type with a UTF-8 charset... is there a benefit of adding accept-charset="UTF-8" to HTML forms? (I understand the accept-charset attribute is broken in IE for ISO-8859-1, but I haven't heard of a problem with IE and UTF-8. I'm just asking if there's a...

How browsers use the STRING defined in the <img src="STRING" /> to load picture file.

I have a very strange problem: I use xsl to show an html picture where the source is defined in the xml file like this: <pic src="..\_images\gallery\smallPictures\2009-03-11 אפריקה ושחור לבן\020.jpg" width="150" height="120" /> [the funny chars are Hebrew- ;) ] Now comes the strange part: When testing the file locally it works ...

ActiveMailer test pass when run through ruby but not when rake test:units

Hi All - I'm having trouble with an activemailer test I created. When I run the test directly with ruby, the test passes. When I run all the unit tests they fail, because the way the message is encoded changed. Running the test from rake test:units breaks the email into multiple mimeparts, that do not exist when running ruby unit/mail...

Sql server 2005 with ASP .NET encoding issue

Hi, I'm writing once again about my encoding issue... Now with some code samples. In a nutshell: when saving to database input data, some language specyfic characters like polish 'ń' won't save - insted 'n' is saved. On the other hand, string: Adams æbler, with æ is saving. Here is code begind code that does save stuff and displays d...

How to deal with different encodings across multiple web browsers

I have a website which contains french, with accents "é, è, à,...". The website displays fine in chrome but those symbols are messed up in firefox. I generated these pages with C# StreamWriter. I choose Encoding "UTF8". I've tried with ISO-8859-1 and ASCII too with little succes. Is there a way to figure out which encoding I can use t...

Filtering unicode column in Sql server 2005 - to much data match

Hi, I have a simple table: CREATE TABLE [dbo].[Users]([Surname] [nvarchar](50) COLLATE Latin1_General_CI_AI NULL) ON [PRIMARY] with two rows: Paweł Pawel Issuing following select statement: SELECT *, CAST(Surname AS VARBINARY(30)) AS Expr1, CAST(N'Paweł' AS VARBINARY(30)) AS Expr1 FROM Users WHERE Surname = N'Paweł' gives foll...

Python char encoding

I have the following code : msgtxt = "é" msg = MIMEText(msgtxt) msg.set_charset('ISO-8859-1') msg['Subject'] = "subject" msg['From'] = "[email protected]" msg['To'] = "[email protected]" serv.sendmail("[email protected]","[email protected]", msg.as_string()) The e-mail arrive with é as its body instead of the expected é I have tried : msgtxt = "é".en...

How do I encode a Binary blob as Unicode blob?

I'm trying to store a Gzip serialized object into Active Directory's "Extension Attribute", more info here. This field is a Unicode string according to it's oM syntax of 64. What is the most efficient way to store a binary blob as Unicode? Once I get this down, the rest is a piece of cake. ...

Download a web page without character replacement

I'm tryng to download a web page in java with the following: URL url = new URL("www.jksfljasdlfas.com"); FIle to = new File("/home/test/test.html"); Reader in = new InputStreamReader(url.openStream(), "UTF-8"); Writer out = new OutputStreamWriter(new FileOutputStream(to), "UTF-8"); int c; while((c = in.read()) != -1){ out.write(c)...