I have an HTML input field linked to a button with an onclick function in javascript that can pass the textfield value to a textfield of another page. While passing the values from one page to another via an URL request of a JSP, I found out that encoding the values with encodeURI() gets :
£ --> £ (2 signs !!)
ö --> ö (2 signs !!)
...
We are building a large search interface with close to 70 properties. Most of these properties are boolean (only hold 0 or 1), around 12 are with int values and some are string.
goal: http://www.example.com/q/test_search/fdgREGd3vfS323
want to avoid: http://www.example.com/q/test_search/?val_12=1000&val_120=0&val_4=XY....
Our ...
We have some code kicking around that uses this old internal Sun package for manipulating images, essentially encoding JPEGs to a specific size and quality after reading in / decoding from an inputstream. Code examples below. I would appreciate a best practice replacement example using proper java.* or javax.* APIs.
private void encod...
I'm POSTing the contents of a form field via AJAX to a PHP script and using Javascript encode(field_contents). The problem is that any plus signs are being stripped out and replaced by spaces. How can I safely 'encode' the plus sign and then appropriately 'decode' it on the PHP side?
...
I am looking for way to encrypt string in C# and to decrypt it using JavaScript. JavaScript in this case is a scripting language for internal system, so I should not worry about people accessing private key/password which will be required for decryption.
Searching online for solution it seems that AES encryption should do the trick. I’...
Hi all,
i have an simple array:
array
0 => string 'Kum' (length=3)
1 => string 'Kumpel' (length=6)
when I encode the array using json_encode(), i get following:
["Kum","Kumpel"]
My question is, what is the reason to get ["Kum","Kumpel"] instead of { "0" : "Kum", "1" : "Kumpel" }?
...
I'm trying to upload an image to PingFM. Their documentation says:
media – base64 encoded media data.
I can access this image via the URL. I tried (practically guessed) this:
ActiveSupport::Base64.encode64(open("http://image.com/img.jpg"))
But I get this error:
TypeError: can't convert Tempfile into String
from /usr/lib/ruby/...
Hi guys I would like to know how I can have PHP display this URL correctly.
Is there a working encoding method I can use that converts all this:
253A%252F%252F
to
://
https%253A%252F%252Fvideos-private.s3.amazonaws.com%252Flesson05.flv
...
How can i convert the 'dead' string to an unicode string u'\xde\xad'?
Doing this:
from binascii import unhexlify
out = ''.join(x for x in [unhexlify('de'), unhexlify('ad')])
creates a <type 'str'> string '\xde\xad'
Trying to use the Unicode.join() like this:
from binascii import unhexlify
out = ''.join(x for x in [u'', unhexlify('d...
I am using jQuery to parse an RSS feed. Within each <item> is a namespaced element like <content:encoded> I want to select. How do I select it in jQuery?
$(xml).find('item') works but $(xml).find('item content') does not.
...
hi all just wrote this:
<?php
function unicodeConvert($str)
{
header('Content-Type:text/html; charset=UTF-8');
$entityRef = array('"' => """, "&" => "&", '¢' => "¢", '¤' => "¤", '¦' => "¦", '¨' => "¨", 'ª' => "ª", '¬' => "¬", '®' => "®", '°' => "°", '²' => "²", '´' => "&acut...
I'd like to convert base 10 numbers to base 31
I would like to use only these characters: 23456789abcdefghjkmnpqrstuvwxyz
As you can see, 5 characters are excluded (i don't need these): 1 0 o l i
The function I have now is below but of course it doesn't work. When 2 is input it outputs 4. The output for tenTo31(2) should be 2
functio...
Hi am trying to pass variables to php from inside an app.
<?php
// get email address
$email = $_GET['email'];
// get character name
$character = $_GET['character'];
// get password
$charname = $_GET['charname'];
// set up variables
$id = 0;
$idtest="no";
// set up database connection
$link = mysql_connect("localhost", "xxx username xx",...
Hi,
I am having an issue whereby a column within a table of mine has data which is encoded using the System.Xml.XmlConvert.Encode method.
Now I need to manipulate this data within SQL and have not found a way to duplicate the System.Xml.XmlConvert.Decode method.
So I've been investigating how I can use the System.XML namespace within S...
Does anyone know of a library for encoding a number of primitive types (like integers, floats, strings, etc) into a string but preserving the lexicographical order of the types?
Ideally, I'm looking for a C++ library, but other languages are fine too. Also, one can assume that the format does not need to be encoded in the string itself ...
I'm working on a project in PHP (5.3.1) where I need to send a JSON string to a webservice (in python), but the result I get from json_encode does not pass as a valid JSON (i'm using JSLint to check validity).
I should add that the structure I'm trying to encode is fairly big (13K encoded), and consists partially of UTF8 data, and while...
I'm trying to URL-escape (percent-encode) non-ascii characters in several URLs I'm dealing with. I'm working with a flash application that loads resources like images and sound clips from these URLs. Since the filenames can contain non-ascii characters, like so:
日本語.jpg
I escape them by utf-8 encoding the characters, and then percent-esc...
theurl = 'http://bit.ly/6IcCtf/'
urlReq = urllib2.Request(theurl)
urlReq.add_header('User-Agent',random.choice(agents))
urlResponse = urllib2.urlopen(urlReq)
htmlSource = urlResponse.read()
if unicode == 1:
#print urlResponse.headers['content-type']
#encoding=urlResponse.headers['content-type'].split('charset=')[-1]
#htmlSour...
Hi,
I have the following route registered;
routes.MapRoute(
"LocationsByArea",
"Locations/{system}/{storage}/{area}",
new { controller = "StorageLocation", action = "Index" },
null
);
...and the following code in my...