encoding

File is not saved in UTF-8 encoding even when I set encoding to UTF-8

When I check my file with Notepad++ it's in ANSI encoding. What I am doing wrong here? OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(file), "UTF8"); try { out.write(text); out.flush(); } finally { out.close(); } UPDATE: This is solved now, reason for jboss not understand...

Why can't I set the XDocument XDeclaration encoding type to iso-8859-1?

Why doesn't the following code set the XML declaration encoding type? It always sets the encoding to utf-16 instead. Am I missing something very obvious? var xdoc = new XDocument( new XDeclaration("1.0", "iso-8859-1", null), new XElement("root", "") ); output: <?xml version="1.0" encoding="utf-16"?> <root></root> ...

Unicode problem in NetBeans 6.7.1

When I type any text on Georgian language. NetBeans shows it like question marks. I'm using Windows7(georgian keyboard). I've also tried in Eclipse, but there is no such problem (everything works fine). Then I've tried to open my Eclipse project folder in NetBeans with some html files and the question marks appeared again. (The html fi...

Silverlight Video Player that plays .MP4 & .FLV

I am currently using the Silverlight 2 Video Player to stream videos. I have been very pleased with it but it only seems to stream .WMV files. Does anyone know if there is a good Silverlight video player that will stream other types of video files, especially .MP4 & .FLV? I would be happy to use Silverlight 3 if necessary. EDIT: Beca...

What's the correct encoding of HTTP get request strings?

Does the HTTP standard or something define which encoding should be used on special characters before they are encoded in url with %XXs? If it doesn't define is there a way define which encoding is used? It seems that most browsers send the data in utf-8. ...

What's the deal with dontEscape support in Uri? .NET 3.5

Documentation state that dontEscape is deprecated and always false. However it actually works. Is it a good idea to use it anyway, or is there any other alternative to send non RFC compliant Http requests? Sample Code: Dim U As New Uri("http://www.google.com/&gt;", True) Dim W As New Net.WebClient() WL(W.DownloadString(U)) ...

iText encoding problem

I have encoding problem with iText (http://www.lowagie.com/iText/). I load data from database and insert it as html to pdf with iText, for some reason my non-english (Finnish ä,ö etc) characters don't show up correctly. Following example shows how insert text to html: text = "<p>" + data + "</p>"; HTMLWorker htmlWorker = new HTMLWorke...

Encoding amount in paypal payment

I'm having trouble figuring out how to prevent people from editing the amount in my shopping cart with tools such as firebug. How do I make sure users can't edit the hidden field? Can I encode the amount before sending it to paypal? Thanks! Francois ...

PHP upgrade problem - Is this an encoding error?

I upgraded php-common and php-devel packages on CentOS 5.3 system. Now, when I try to access any PHP script in a browser I get garbage like this: If I try to CURL GET the page, or try plain HTML, CSS or JS in the browser everything looks OK. Encoding is set to UTF-8 in both PHP itself and the PHP output via "Content-Type: text/html; ...

Why does HttpUtility.UrlEncode(HttpUtility.UrlDecode("%20")) return + instead of %20?

I'm having a problem with a file download where the download is replacing all the spaces with underscores. Basically I'm getting a problem here: Response.AddHeader("Content-Disposition", "attachment; filename=" + someFileName); The problem is that if someFileName had a space in it such as "check this out.txt" then the user would...

Howto use maven in a heterogenous environment with different encodings?

I've created a svn repositoy on a linux server (Debian) and used a client on a windows machine to check my java sources in. Now I've set up a Hudson server on a different linux server (Ubuntu) to periodically run tests on my code. But the tests fail with a compiler error: Error: unmappable character for encoding ASCII On my windows ...

Converting data from nvarchar to varchar in C#

As part of an integration task I am doing, I have a column in my database that has the type nvarchar(30) and I need call a WCF service and pass through the values in this column (among others) that will then be stored in a column that has the type varchar(30) in the other database. What should I do (presumably in the code that calls the...

How to a recover a text from a wrong encoding?

I have got some files created from some asian OS (chinese and japanese XPs) the file name is garbled, for example: иè+¾«Ñ¡Õä²ØºÏ¼­ how i can recover the original text? I tried with this in c# Encoding unicode = Encoding.Unicode; Encoding cinese = Encoding.GetEncoding(936); byte[] chineseBytes = chinese.GetBytes(garbledString); b...

Character with encoding UTF8 has no equivalent in WIN1252

I am getting the following exception: Caused by: org.postgresql.util.PSQLException: ERROR: character 0xefbfbd of encoding "UTF8" has no equivalent in "WIN1252" Is there a way to eradicate such characters, either via SQL or programmatically? (SQL solution should be preferred). I was thinking of connecting to the DB using WIN1252 but i...

How to convert the encoding of an string to UTF-8 without know the original encoding in C#?

I'm reading a CSV file with Fast CSV Reader (on codeproject). When I print the content of the fields, the console show the character '?' in some words. How can fix it? ...

utf-8 to iso-8859-1 encoding problem

I'm trying preview the latest post from an rss feed on another website. The feed is UTF-8 encoded, whilst the website is ISO-8859-1 encoded. When displaying the title, I'm using; $post_title = 'Blogging – does it pay the bills?'; echo mb_convert_encoding($post_title, 'iso-8859-1','utf-8'); // returns: Blogging ? does it pay the b...

jquery ajax encoding issue

$("#footerform").submit(function(){ $.ajax({ type: "POST", url: "contactrespajax.asp", data: $("#footerform").serialize(), success: function(){ $("#footerform").hide("slow"); $("#result").show("slow"); } }); }); it is submitting a contact form which is sent to my email using ASP CDO.Message. when i sub...

Post form data and sending it using mail - php

Hello, I have some troubles with encoding and mailing. I send post-request to php-script, when I do print_r( $_POST ); I could see my text normally, but when I'm trying to send it into email, using code: $text = ...; // Includeing data from $_POST; $headers = "From: test\r\n"; $headers .= "Return-Path: test\r\n"; $header...

properly endcoding & for twitter post

My automated call to the Twitter API causes problems when my update string has a & in it. How do I properly encode my update string $update that contains a & before I use CURL to call the Twitter API? // Set username and password for twitter API $username = '***'; $password = '***'; // The twitter API address $url ...

What encoding is this... and how do you escape it in php?

Im working on an imdb data scraper for a site, and I they seem to encode everything in a weird encoding I never saw before. <a href="/keyword/exploding-ship/">Exploding&#xA0;Ship</a> A Bug&#x27;s Life Is there a php function that will convert these to regular characters? ...