encoding

How to URL encode this so I can pass it to Facebook Share?

This is the URL I want to share: http://mydomain.com/#url=http://stackoverflow.com Inside my site, I do this in Django so that everything will work: http://mydomain.com/#url={{external|urlencode}} However, when I pass it to Facebook Share, everything gets messed up. http://www.facebook.com/sharer.php?u=&lt;url to share>&t=<title o...

MySQL Collation or PHP side to display accented letters properly

What is the best Collation for the column that can allow to store accented letters and parse them out perfectly without any encoding error, because whenever I add an accented letter such as é, å, it shows out with an encoding problem on the PHP side, but in the MySQL side it's fine... How do I get the accented letters display properly? ...

Encoded nsstring becomes invalid, "normal" nsstring remains

I'm running into a problem with a string that contains encoded characters. Specifically, if the string has encoded characters it eventually becomes invalid while a "normal" string will not. in the .h file: @interface DirViewController : TTThumbsViewController <UIActionSheetDelegate,UINavigationControllerDelegate,UIImagePickerControlle...

Java mail encoding

Using the code below i can send an email written in non-english and although the subject appears correctly the body appears as gibberish. Any ideas? Thank you public void postMail(String recipient, String subject, String message, String from) throws MessagingException, UnsupportedEncodingException { //Set the host smtp addr...

'£' character does not seem to encode properly - expect '%a3' but get '%u00a3'

Hello, I want to send The pound sign character i.e. '£' encoded as ISO-8859-1 across the wire. I perform this by doing the following: var _encoding = Encoding.GetEncoding("iso-8859-1"); var _requestContent = _encoding.GetBytes(requestContent); var _request = (HttpWebRequest)WebRequest.Create(target); _request.Headers[HttpRequestHeader...

Why does Visual Studio 2008 change namespace characters in a generated file?

Hello, I am working on a asp.net 3.5 project in sweden, where some of the namespaces include swedish characters, such as 'å', 'ä' and 'ö'. When building the project and generating the design-file, visual studio replaces these characters with some other strange characters. This only happens when the characters occur in a namespace or cl...

Encoding issue - 2nd band of ISO-8859-1 values do not get encoded?

Hello, I want to send the pound sign character i.e. '£' encoded as ISO-8859-1 across the wire. I perform this by doing the following: var _encoding = Encoding.GetEncoding("iso-8859-1"); var _requestContent = _encoding.GetBytes(requestContent); var _request = (HttpWebRequest)WebRequest.Create(target); _request.Headers[HttpRequestHea...

Python unicode issues (2.6)

I'm currently working on a irc bot for a multi-lingual channel, and I'm encountering some issues with unicode which are proving nearly impossible to solve. No matter what configuration of unicode encoding I seem to try, the list function which the below code sits within just flat out does nothing (c.notice is a class function which sen...

Delphi 7 - Why does Windows 7 change encoding of characters in runtime?

I have a delphi 7 form: and my code: when I run this form in Windows 7, I see: In design time, form had polish letters in first label, but it doesn't have them in runtime. It looks ok on Vista or Windows XP. When I set caption of second label in code, everything works fine and characters are properly encoded. First 5 codes of t...

printing to Postscript from vim

Hi, I have problem with printing to postscript from Vim. I'm, using utf-8 encoding with czech characters like 'ščřž' but in the output I get upside question mark instead of the correct characters. vim --version VIM - Vi IMproved 7.2 +iconv +multi_byte +postscript printer settings: set printoptions=paper:A4,duplex:off,collate:n,syn...

Django: Getting a Python encoding error when handling HTTP response in Latin1?

I'm working in Django, and using urllib2 and simplejson to parse some information from an API. The problem is that the API returns information in the Latin-1 encoding, and just once in a while there's a character in there that causes Django to crash horribly with an encoding error. This is my code: get_person_id_url = "http://www.domai...

Converting an AnsiString to a Unicode String

I'm converting a D2006 program to D2010. I have a value stored in a single byte per character string in my database and I need to load it into a control that has a LoadFromStream, so my plan was to write the string to a stream and use that with LoadFromStream. But it did not work. In studying the problem, I see an issue that tells me t...

What's a better solution to a site with UGC (video)?

We are trying to build a site with user generated video content, finalized on either brightcove or encoding.com + amazon cloud front. Our requirement is more on gathering the videos than showcasing. What would be better alternative? Does brightcove provide decent apis for managing UGC? ...

How to encode a 8 byte block using only digits (numeric characters)?

I need to encode streams of 8 byte such that encoded stream has only digits (zero to nine) in them. Are their any standard encoding mechanism for doing this? If there are multiple ways to do it, which one is efficient in terms of length of encoded string (shorter is better)? ...

Python UTF-8 can't decode byte on 32-bit machine

it works fine on 64 bit machines but for some reason will not work on python 2.4.3 on a 32-bit instance. i get the error 'utf8' codec can't decode bytes in position 76-79: invalid data for the code try: str(sourceresult.sourcename).encode('utf8','replace') except: raise Exception( repr(sourceresult.sourcename ) ) ...

ASP.Net menu databinding encoding problem

Hi, I have a menu where I bind data through: XmlDataSource xmlData = new XmlDataSource(); xmlData.DataFile = String.Format(@"{0}{1}\Navigation.xml", getXmlPath(), getLanguage()); xmlData.XPath = @"/Items/Item"; TopNavigation.DataSource = xmlData; TopNavigation.DataBind(); The problem is when my xml has...

Efficient way to ASCII encode UTF-8

I'm looking for a simple and efficient way to store UTF-8 strings in ASCII-7. With efficient I mean the following: all ASCII alphanumeric chars in the input should stay the same ASCII alphanumeric chars in the output the resulting string should be as short as possible the operation needs to be reversable without any data loss the resul...

How to convert Java Image into JPEG array of bytes?

Is there a way to convert a Java Image, encode it into JPEG (but not saving it to a file), and store it as an array of bytes? (byte[]) I need the JPEG-encoded image as an array of bytes. ...

Html.Encode question

I'm working through the NerdDinner MVC tutorial and came across this and was wondering about. On page 62 of the pdf they have the following: <asp:Content ID="Main" ContentPlaceHolderID="MainContent" runat="server"> <h2>Upcoming Dinners</h2> <ul> <% foreach (var dinner in Model) { %> <li> <a h...

Encryption is hard: AES encryption to Hex

So, I've got an app at work that encrypts a string using ColdFusion. ColdFusion's bulit-in encryption helpers make it pretty simple: encrypt('string_to_encrypt','key','AES','HEX') What I'm trying to do is use Ruby to create the same encrypted string as this ColdFusion script is creating. Unfortunately encryption is the most confusing ...