encoding

java.io.FileNotFoundException when retrieving a url with umlauts in the filename

I am trying to retrieve a url with an umlaut in the filename, something like "http://somesimpledomain.com/some/path/überfile.txt", but it gives me a java.io.FileNotFoundException. I suspect that the filename on the remote server is encoded in latin1, though my url is in utf8. But my tries to change the encoding of the url weren't success...

How to encrypt using public key?

msg = "this is msg to encrypt" pub_key = M2Crypto.RSA.load_pub_key('mykey.py') // This method is taking PEM file. encrypted = pub_key.public_encrypt(msg, M2Crypto.RSA.pkcs1_padding) Now I am trying to give file containing radix64 format public key as a parameter in this method and unable to get expected result i.e encryption using ra...

Visual Studio C# disable unicode or utf-8 as file encoding and use ASCII instead.

Hello *, I am currently working on some LaTeX document which embeds C# files generated by Visual Studio 2008. My problem is that these files are encoded in UTF-8 with BOM. This causes LaTeX to produce output similar to the output described in this post: Invalid characters in generated latex sources in Doxygen? I know that I can use a t...

Charts with proper unicode support

I want to create simple charts like pies and bars in python. I tried out CairoPlot and pycha. Both look amazing, but they seem not to be able to handle unicode characters properly. CairoPlot.pie_plot(name='test.png', width=800, height=600, data={'eins':100, 'zwei':48, 'drei':90, 'vier':98,u'fünf':187}) result in f...

HTML encoding issues - "Â" character showing up instead of " "

Hey everyone, I've got a legacy app just starting to misbehave, for whatever reason I'm not sure. It generates a bunch of HTML that gets turned into PDF reports by ActivePDF. The process works like this: Pull an HTML template from a DB with tokens in it to be replaced (e.g. "~CompanyName~", "~CustomerName~", etc.) Replace the tokens...

PHP File Opening Encoding Problem?

hellom, When I try to open a .log file created by a game in PHP I get a bunch of this. ÿþ*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*� � K�2� �E�n�g�i�n�e� �s�t�a�r�t� �u�p�.�.�.� � [�2�0�0�9�/�2�2�/�0�9�]� � [�1�6�:�0�7�:�3�3�]� � [�0�.�1�.�4�6�.�0�]� � [�0�]� ...

Do we need to check the encoding scheme when reading properties file?

Today one of my testers came to me and said my program had failed her test. All she did was actually open up all my properties files and save them as Unicode format. Questions: Is there an industry practice to check every properties file encoding type? How do you deal with this problem? I've never seen any java project running en...

How to list valid Iconv encodings in Ruby?

Hello, how to get a list of valid Iconv encodings in Ruby 1.9.1 under windows 7? ...

Two encoding in one HTML document

Hi all, My problem is this: I am copying a set of HTMLs from a machine to other one, and I am adding more information into the target HTMLs as a element. The problem I have is that the source documents are encoded in a lot of different encodings [UTF8, 8859-1, GB1232, etc.] and the meta information is stored as UTF-8, so, when I "dumm...

Japanese Text are displayed as garbled text in Eclipse for non java/jsp file like js/inc

I would like to ask how can i display Japanese text in Eclipse properly. I work in Japan and the code we have has a lot of Japanese characters. I just notice that for .java and .jsp file, that all the Japanese comments and text are displayed properly as Japanese. However, for other filesm such as js (Javascript) file or inc (include) fil...

PHP: Checks to see if a string is utf8 encoded? How?

function seems_utf8($str) { $length = strlen($str); for ($i=0; $i < $length; $i++) { $c = ord($str[$i]); if ($c < 0x80) $n = 0; # 0bbbbbbb elseif (($c & 0xE0) == 0xC0) $n=1; # 110bbbbb elseif (($c & 0xF0) == 0xE0) $n=2; # 1110bbbb elseif (($c & 0xF8) == 0xF0) $n=3; # 11110bbb elseif (($c & 0xFC) == 0xF8) $n=4; # 111110bb ...

ASP.NET MVC file encoding

Hi, I first worked on a page with an external editor (simply Notepad++). Since the content is Italian, I set the enconding to UTF-8 and all the symbols I needed just worked. The relevant parts are: <?xml version="1.0" encoding="UTF-8"?> [..] <html xmlns="http://www.w3.org/1999/xhtml" lang="it"> <meta http-equiv="Content-Type" conten...

PHP outputs a normal question mark instead of ‘ or ’

Hi, I'm currently parsing an RSS feed and subparsing the html in the description field in order to create a custom XML structure. In the description field there are ‘ and ’ signs and PHP outputs them as regular question marks. How come? I've tried different encodings like UTF-8 and iso-8859-1 but nothing works.. This is the xml I'm p...

UTF-8 encoding issue

Hi, I am trying to fetch data from rss feed (feed location is http://www.bgsvetionik.com/rss/ ) in c# win form. Take a look at the following code: public static XmlDocument FromUri(string uri) { XmlDocument xmlDoc; WebClient webClient = new WebClient(); using (Stream rssStream = webClient.OpenRead(uri)...

Ultimate Website Testing String

Hi all. I've been grappling with the fraught area of escaping user (text) input for web pages. The ultimate goal is to have user input displayed and stored exactly as typed in, without breaking anything. To that end I have been using the following test string : '"$%^&()+=-£{}[]/n/<>\@~;|,.?#:!&amp;``&quot;&#39; It seems to work we...

What are the ways to convert/encode to AAC in Cocoa?

Is there a way to programmatically convert and/or encode to AAC/m4a format in Cocoa without the use of any libraries or programs that don't ship with Mac OS X? I don't want to use for example, faac or ffmpeg, to do the encoding. ...

c# How to process the string?

Hi! I connect to a webservice that gives me a response something like this(This is not the whole string, but you get the idea): sResponse = "{\"Name\":\" Bod\u00f8\",\"homePage\":\"http:\/\/www.example.com\"}"; As you can see, the "Bod\u00f8" is not as it should be. Therefor i tried to convert the unicode (\u00f8) to char by doing this...

ASIHTTPRequest: Encoding in post data

I'm using ASIHTTPRequest to send a form this way: ASIFormDataRequest *request = [[[ASIFormDataRequest alloc] initWithURL:url] autorelease]; [request setPostValue:foo forKey:@"post_var"]; How can I set the encoding of the nsstring foo?? The web receiving the form data expects the value in ISOLatin1 ...

C# UTF-8 Encoding Problem

I've searched posts here on Stack Overflow, and read JoelOnSoftware's post on encoding, and now have a basic grasp of encoding issues. But I'm running into a problem with some character encoding coming from the Windows clipboard. The reproducible test is to use IE and select and copy the "Advertising Programs" text from the Google home...

How to replace � in a string

I have a string that contains a character � I haven't been able to replace it correctly. String.replace("�", ""); doesn't work, does anyone know how to remove/replace the � in the string?? ...