encode

Strange \n in base64 encoded string in Ruby

The inbuilt Base64 library in Ruby is adding some '\n's. I'm unable to find out the reason. For this special example: irb(main):001:0> require 'rubygems' => true irb(main):002:0> require 'base64' => true irb(main):003:0> str = "1110--ad6ca0b06e1fbeb7e6518a0418a73a6e04a67054" => "1110--ad6ca0b06e1fbeb7e6518a0418a73a6e04a67054" irb(main)...

Need help with PHP URL encoding/decoding

On one page I'm "masking"/encoding URL which is passed to another page, there I decode URL and start file delivering to user. I found some function for encoding/decoding URL's, but sometime encoded URL contains "+" or "/" and decoded link is broken. I must use "folder structure" for link, can not use QueryString! Here is encoding func...

Best Way To Encode and Decode Text PHP

Hello, I'm looking for a method in which I can decode and encode text to be passed in a url. Not base64 Any others? ...

How to simply encode and decode a string variable with javascript.

I need to simply encode a string variable (my api key) so that is not easily readable by human eyes, I need it to easily decode back to exactly the same initial string. What is the standard practical and fast (less computing on the user side) way to do this? Many thanks in advance! ...

What is the fastest / best Base64 en/decoder for Java ?

Just found the MIG Base 64 utility but its over 6 years old since its last release. It would appear to be quicker than the Apache commons equivalent but I have yet to confirm by writing up an actual test. Has anyone verified its correctness which is always a worry. If someone takes a look at the methods, please note i a referring to the ...

Passing Byte (VB.NET)

Hi I need to pass encoded string to php page. To convert string to iso: Dim result As Byte() = Encoding.Convert(Encoding.UTF8, Encoding.GetEncoding("iso-8859-1"), input) I have this code to pass string, but how I must do it to pass Byte (variable result) instead of the string (variable MyVarString)? Dim client As WebClient Dim dat...

Correctly encode characters in a PHP mail form ("I'm" turns to be "I\'m")

Hello guys, I'm testing a PHP mail form, a very barebones one, found here: <?php if(isset($_POST['submit'])) { //The form has been submitted, prep a nice thank you message $output = '<h3>Thanks for your message</h3>'; //Deal with the email $to = '[email protected]'; $subject = 'you...

Alt attribute encoding with JavaScript

Hi, Html entities must be encoded in alt attribute of an image in HTML page. So <img id="formula" alt="A &rarr; B" src="formula.png" /> will work well. On the other hand, the same JavaScript code will not work document.getElementById('formula').alt = 'A &rarr; B'; and will produce A &rarr; B instead of A B. How to do it through...

[Iphone] - Problem in saving file using NSCoding

Hi everybody, I've a problem with Iphone programming... I've a NSMutableArray containing object of type "MyClass". MyClass has some parameters, like NSNumber and NSString. I've followed the Apple Tutorial about coding and decoding object using NSCoding, but when I try to decode the file I've stored, the NSMutableArray contain object of...

Webcam capture and convert to avi

Im trying to make a program that captures a video from the webcam and sound from the microphone but im getting stuck at the part where ive try to make a movie out of still images ive heard you need to use directshow but it doesnt jet work for me Does someone know a good piece of example code that captures video and sound and can encod...

FFmpeg + iPhone - Interesting (incorrect?) video encoding results

I'm encoding some video on the iPhone by running the png image data through swscale to get YUV420P data then encoding that frame using the MSMPEG4V1 codec. In the api docs, avcodec_encode_video should return the number of bytes used from the output buffer by that encode operation. There are 234,000 bytes going into the encoder, but the ...

PHP unserialize fails with non-encoded characters?

$ser = 'a:2:{i:0;s:5:"héllö";i:1;s:5:"wörld";}'; // fails $ser2 = 'a:2:{i:0;s:5:"hello";i:1;s:5:"world";}'; // works $out = unserialize($ser); $out2 = unserialize($ser2); print_r($out); print_r($out2); echo "<hr>"; But why? Should I encode before serialzing than? How? I am using Javascript to write the serialized string to a hidden fi...

How to decode such strange string to UTF-8? (PHP)

So I have %u041E%u043B%u0435%u0433%20%u042F%u043A how to save it into real UTF-8 or (better for me to HTML entities)? ...

is this code useful ?

def _oauth_escape(val): if isinstance(val, unicode):# useful ? val = val.encode("utf-8")#useful ? return urllib.quote(val, safe="~") i think it is not useful , yes ?? updated i think unicode is ‘utf-8’ ,yes ? ...

why my code show messy code ..

class sss(webapp.RequestHandler): def get(self): url = "http://www.google.com/" result = urlfetch.fetch(url) if result.status_code == 200: self.response.out.write(result.content) and this view show : when i change code to this: if result.status_code == 200: self.response.out.write(result.content.de...

best parameter iphone/ffmpeg

Hi, What are better parameter to encode some image on iphone with ffmpeg?? I read that .mov and codec MJPEG are most speed really?? Now my program is very slow, with 1/5fps get a video with most low quality in 7 second. What is codec more speed? and your parameter? best regards ...

How to convert all characters to their html entity equivalent using PHP

I want to convert this [email protected] to &#104;&#101;&#108;&#108;&#111;&#064;&#100;&#111;&#109;&#097;&#105;&#110;&#046;&#099;&#111;&#109; I have tried: url_encode($string) this provides the same string I entered, returned with the @ symbol converted to %40 also tried: htmlentities($string) this provides the same string righ...

How to encode series of images into VP8 using WebM VP8 Encoder API? (C/C++)

How to encode RBG images into on VP8 frames (Keyframe + some dependent frames)? So I created some images how to turn tham into VP8 now? ...

PHP XML encoding

I need a function that will convert € or chr(0x20AC) or chr(8364) to &#8364; without having a static map. I tried using htmlentities(), but it only seems to work for the symbol itself and it converts to &euro;. ...

Perl Encode - UK characters

This is a part 2 question from This Question. So I'm trying out the :encode functionality but having no luck at all. use Encode; use utf8; # Should print: iso-8859-15 print "Latin-9 Encoding: ".find_encoding("latin9")->name."\n"; my $encUK = encode("iso-8859-15", "UK €"); print "Encoded UK: ".$encUK."\n"; Results: Encoded UK: UK ...