encoding

Wrote to a file using std::wofstream. The file remained empty...

I wrote the following program using VS2008: #include <fstream> int main() { std::wofstream fout("myfile"); fout << L"Հայաստան Россия Österreich Ελλάδα भारत" << std::endl; } When I tried to compile it the IDE asked me whether I wanted to save my source file in unicode, I said "yes, please". Then I run the program, and myfile ap...

When you use System.Net.MailMessage to dynamically send emails, why aren't you required to specify any encoding?

In my vague understanding, any texts are transferred over the internet as streams of bytes. And when you change texts to and from bytes, you need encoding. MailMessage.Body is just a plain string(text) and it gets sent over the internet as emails. Why is it that it can correctly display Chinese characters without even having to specify t...

Is a (unicode) String encoding neutral?

In .NET, a string is a unicode character string. My understanding is the string itself does not contain any particular encoding information, ie is encoding neutral? You can use any encoding method to decode a string into a stream of bytes and then encode a stream of bytes into a recognizable string, as long as the encoding method matches...

WP7's WebBrowser.NavigateToString() and text encoding

Hi, does anyone know how to load a UTF8-encoded string using WebBrowser.NavigateToString() method? For now I end up with a bunch of mis-displayed characters. Here's the simple string that won't display correctly: webBrowser.NavigateToString("ąęłóńżźćś"); The code file is saved with UTF-8 encoding (with signature). Thanks. ...

Encoding conversion from RSS feed chars.

Hello, I am trying to show a simple text RSS feed from a CodePlex project in a window. My problem is that the feed text contains a lot of character sequences that looks like: &#58; &#45; etc.. I know that they represent the punctuation and some special chars, with some kind of encoding, but I do not know how I can convert them back ...

Android. WebView and loadData

It's possible to use following method for content's setting of a web-view loadData(String data, String mimeType, String encoding) How to handle the problem with unknown encoding of html data?! Is there a list of encodings?! I know from my college that in my case html comes from DB and is encoded with latin-1. I try to set encoding par...

Character Encoding Issue

I'm using an API that processes my files and presents optimized output, but some special characters are not preserved, for example: Input: äöü Output: äöü How do I fix this? What encoding should I use? Many thanks for your help! ...

Different encoding results when using writeToFile:atomically:encoding:error: vs. createFileAtPath:contents:attributes:

Hi there, In my iPhone App I have the capability to export data to an .txt file and send it via Mail – but have currently problems regarding the encoding. To attach the file to mail I simply create a NSData instance from a NSString instance as followed: NSData *dataToExport = [[NSData alloc] initWithData:[myExportString dataUsingEncod...

Setting encoding in XML files

Which are the valid xml encoding strings? For instance, what is the way of specifying UTF-8: encoding="utf8" encoding="utf8" etc Or Windows 1251: encoding="windows-1251" encoding="windows1251" encoding="cp-1251" etc. I am making a character decoder as well as a xml parser. Thus, I need to be able to set the encoding of my StreamR...

How to find Encoding for 1251 codepage

Hi I need to create System.Encoding for 1251 codepage. On my russian Windows I use Encoding encoding = Encoding.Default I am afraid this will produce different results depending on Windows ...

How to include quote characters as a route parameter? Getting "Illegal characters in path" message

I have a search box that exists on all pages. The user can enter text, and click search and they end up on the Search page with the results displayed for them. When search is clicked, the form containing the textbox is sent off to the following route: http://localhost:2010/search/my%20search%20term this works. But if I put quotes aro...

Getting strange characters from a JSON response from Facebook

Hi all. I'm having troubles when I want show a JSON response. I extract correctly the strings but when there is characters like 'á' or '¿' instead of these ones appears 'Ãi' or '¿'. I think that the response comes in non-UTF8 enconding, but I cannot find how to convert it. EDIT: I'm trying to do a GET request to this URL: https://gra...

How to encod the html entiiesusing php

i am using ck editor to compose my mail , to send mails to my user i am using the libmail class. my issue is if i echo the posted data from the ckeditor eg: echo $message = $_POST['editor1']; output : " < data > " but if i send the message using the libmail the mail sended like this <p> &quot;&nbsp; &lt; dat...

Javascript link in aspx page within a SharePoint frame replaces apostrophes to #39 element

I have problem with SharePoint encoding the javascript link, that normally renders like href="javascript:Function('url');" but in Sharepoint like href="javascript:Function(& #39;url& #39;)" wich of course does not work. What do I need to do? I need to be able to use my user control as stand alone as well as linked into a sharepoint pag...

How to convert ISO-8859-1 to UTF-8 using libiconv in C++

I'm using libcurl to fetch some HTML pages. The HTML pages contain some character references like: &#1505;&#1500;&#1511;&#1493;&#1501; When I read this using libxml2 I'm getting: ׳₪׳¨׳˜׳ ׳¨ is it the ISO-8859-1 encoding? If so, how do I convert it to UTF-8 to get the correct word. Thanks EDIT: I got the solution, MSalters was right...

Reference encoding error byte in Python

Suppose I type line = line.decode('gb18030;) and get the error UnicodeDecodeError: 'gb18030' codec can't decode bytes in position 142-143: illegal multibyte sequence Is there a nice way to automatically get the error bytes? That is, is there a way to get 142 & 143 or line[142:144] from a built-in command or module? Since I'm fairly co...

Foreign Characters Appearing In Git-Managed Files

I am using git 1.7.2.3 via cygwin on Windows 7 and seeing strange artifacts appearing in some of my source files when switching branches. git status reports everything as unchanged yet they crazy characters are present. I've confirmed on GitHub that the files are as they should be in the repo. My Copy: ਍        ⼀⼀⼀ 㰀猀甀洀洀愀爀礀㸀ഀഀ ...

Character encoding problem using ScrollableResults and MySql

I'm doing private void doSomething(ScrollableResults scrollableResults) { while(scrollableResults.next()) { Object[] result = scrollableResults.get(); String columnValue = (String) result[0]; } } I tried this in two computers It works fine. It is a Windows 7. System.getProperty("file.encoding") returns Cp1252. ...

Error correction code for non-uniform errors on non-binary channel?

If you ask a person to type in a page full of random hand written 20 digit numbers, I would expect that you would see different errors occur with non uniform frequency (e.g. switching 6 and 5 or 3 and 8 would be more common than 7 and 0). Are there any error correction codes that incorporate that sort of error functions into there constr...

Rails Json response encoding

I've a rails controller that respond_to JSON with a wrong encoding. The site is correctly setup with UTF-8 encoding and the database as well. The text in my db is well formatted, but in the JSON response, all special characters are set to \ufffd. How can I solve the problem? ...