charset

Is there a way to set charset using the web.config in asp.net?

Recently I came across a situation where, while using a double-byte language, I had to enter the charset as a metatag. Previously I had thought that the globalization tag in the web.config would handle the page charset, but this seems not to be the case. Is there a way to set charset in the web.config or a way to set the charset of an ...

db4o data to listview charset problem

I'm loading some data from a db4o database to a listview. some of the strings do have ä,ö,ü,ß characters. In VS Debugger they do look alright but when parsing them into a listview they are not correcly displayed. I'm using C# + Winforms ...

failed to change page character set in meta

Code as follows: <meta http-equiv="Content-type" content="text/html; charset=utf8" /> But when I browse the page using IE, it still uses its default charset, which is not utf8. And the page becomes normal only after I set the character set to utf8 manually. Why the HTML failed to inform browser of its character set? It's on local f...

PHP + SQL Server - How to set charset for connection?

I'm trying to store some data in a SQL Server database through php. Problem is that special chars aren't converted properly. My app's charset is iso-8859-1 and the one used by the server is windows-1252. Converting the data manually before inserting doesn't help, there seems to be some conversion going on. Running the SQL query 'set ...

Rescuing corrupted characters in database

I have just imported a huge MySQL database. Most fields are latin1_swedish_ci, and they contain lots of corrupted strings. e.g. Cavit Y�r�kl� instead of Cavit Yürüklü I have been trying to find a solution to fix these corruptions using PHP as thats all I know a little bit of. I have played unsuccessfully with utf8_(en|de...

How to change NetBeans charset?

I researched on google and I found this article, but my codes still being saved as ansi. Notepad++ has a feature to change/convert the code charset, does someone know if there exists any option in Netbeans? nebeans.conf: netbeans_default_options="-J-Dorg.glassfish.v3.installRoot=\"E:\Programs\sges-v3-prelude\" -J-Dcom.sun.aas.installRo...

How do I keep an ASP.NET TextBox from HTML-encoding its content?

Hi there, the "problem" is that I do have an ASP.NET TextBox in a FormView with its Text property bound to a database table field. In some cases, there might be HTML-code combined with normal text in the database. The RequestEncoding and ResponseEncoding is set to "iso-8859-1" (whitch is latin1). There are some fields where latin1-chara...

How to detect character set encoding?

For example, chinese text(GB2312) is pasted into a text box(or text area) of a html page and the form is posted. At the server side, is there any means by which this character set gets detected? How would this detection behave if texts belonging to different character sets are pasted in a text box? ...

Some UTF-8 characters do not show up on browser

Some UTF-8 characters like the UTF-8 equivalent of C2 96 (hyphen). On the browser it displays it as – (utf box with 00 96). And not as '-'(hyphen). Any reasons for this behavior? How do we correct this? http://stuffofinterest.com/misc/utf8.php?s=128 (Refer this URL for the codes) I found that this can be handled with html entities. Is...

character encoding problem - cross-domain scripting

Hello, I have an Asp.Net web app which users include a script tag in their web page, and get data from my server (using JsonP & a Generic handler (ashx)) The data is in hebrew, and I set the charset to utf-8 in the response. When the client web site (which displays the data) uses "windows-1255" I don't see the text properly. The sc...

Convert ANSI characters to UTF-8 in Java

Is there a way to convert an ANSI string to UTF using Java. I have a custom serializer that uses readUTF & writeUTF methods of the DataInputStream class to deserialize and serialze string. If i receive a string encoded in ANSI and is too long, ~100000 chars long i get the error; Caused by: java.io.UTFDataFormatException: encode...

Creating tar archive with national characters in Java

Hi, Do you know some library/way in Java to generate tar archive with file names in proper windows national codepage ( for example cp1250 ). I tried with Java tar, example code: final TarEntry entry = new TarEntry( files[i] ); String filename = files[i].getPath().replaceAll( baseDir, "" ); entry.setName( new String( filename.getBytes...

How to create ZIP files with specific encoding

Hello, On my Linux server I have some files with accented names (test-éàïù.zip). When I add them to a new ZIP file using 7zip command-line tool, the charset/encoding information is not saved and when opened on a Windows computer, the archive does not correctly display filenames. I know that 7zip creates Zip V1.0 archives, not 2.0. Maybe...

Why does php DOM parsing affect charset?

$dom = new DOMDocument(); $dom->loadHTML($string); $dom->preserveWhiteSpace = false; $elements = $dom->getElementsByTagName('span'); $spans = array(); foreach($elements as $span) { $spans[] = $span; } foreach($spans as $span) { $span->parentNode->removeChild($span); } return $dom->saveHTML(); //return $string; When I use this code t...

vim and unrecognized characters

I have a file with some accents, and VIM displays them as "~V" characters. The "od -bc" command tells me the characters are charcode 226. I want to substitute them using VIM. But I can't get it to match the characters. How can I achieve that? Optional question: how can I have VIM tell me which charset is used to interpret the current fi...

HTML forms: issues combining charset with enctype in Firefox

I have a Web site with a message board. The board lets people post messages and include attachments. I had a problem where my site was hiccuping every time someone wrote a post with non-Unicode characters. In an effort to solve it, I changed my HTML form code from enctype="multipart/form-data" (as I'm accepting file uploads) to: enct...

Convert latin1 string to utf8?

Hello, how can I convert a string, that contains latin1 characters to utf8? The string is a document, that is opened by open-uri and that contains these special characters. Best regards ...

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...

sending a charset in the Content-Type header

i use jquery $ajax to post a contact form to my email. but encoding is wrong and i see question marks. i figured i should set the content-type but cant manage to do so. am using asp thx ...

Avoid creating 'new' String objects when converting a byte[] to String using a specific charset

I'm reading from a binary file and want to convert the bytes to US ASCII strings. Is there any way to do this without calling new on String to avoid multiple semantically equal String objects being created in the normal object pool? I'm thinking that it is probably not possible since introducing String objects using double quotes is not ...