encoding

Take control over email subject in rails

I need to change the subject of the emails on a low level. What rails does is encoding the subject as quoted in whatever encoding is set. What I need is to make it quoted but split into chunks of 64 byte, as hotmail doesn't really goes with the standards :/ How do I tell rails to take the subject as is? ...

Upload a file with encoding using FTP in c#

Hello The following code is good for uploading text files but it fails to upload jpg files: (not completely - the file name is good but the image is corrupted) private void up(string sourceFile, string targetFile) { try { string ftpServerIP = ConfigurationManager.AppSettings["ftpIP"]; string ftpUser...

Is it possible to show data of different encodings in the same page?

I have two tables here - one is in UTF and holds Arabic text as it can be read. The other one has a different encoding however and the content is Arabic however in the database its displayed as ÈöÓúãö Çááøåö ÇáÑøóÍúãóäö ÇáÑøóÍöíãö I have to show data from both tables on the same page - the page is UTF encoded however I'm not sure if ...

Java, XML DocumentBuilder - setting the encoding when parsing

Hi I'm trying to save a tree (extends JTree) which holds an XML document to a DOM Object having changed it's structure. I have created a new document object, traversed the tree to retrieve the contents successfully (including the original encoding of the XML document), and now have a ByteArrayInputStream which has the tree contents (X...

how to remove all utf-8 characted from string using php

Hi I have a problem as below. I have one xml which contain utf-8 characters but the data of this xml will get displayed on page with iso encoding. So I have to remove this utf-8 charactres from string, How can I do this. Thanks Avinash EDIT: I have used : iconv("ISO-8859-1", "UTF-8", str_replace('&','and',removeEmptyLines(strip_tags(...

Ajax response with french encoding

Is it possible to make json response with characters in french encoding? IE6 never invoke callback function to handle json response. ...

PHP and character encoding problem with  character

I'm having a problem where PHP (5.2) cannot find the character 'Â' in a string, though it is clearly there. I realize the underlying problem has to do with character encoding, but unfortunately I have no control over the source content. I receive it as UTF-8, with those characters already in the string. I would simply like to remove it...

Fix incorrectly displayed encoding on an html document with php

Is there a way to fix the characters that display improperly after running this html markup through phpquery::newDocument? There are slated double quotes around -Classics with modern Woman- in the original document that end up displaying improperly after creating the new doc with phpquery. //Original document is UTF-8 encoded $raw_h...

How can I avoid users entering php code into my form

How can I stop users entering <?php ?> into my forms. I am using urlencode() and then using urldecode() when echoing data onto my page what is the best thing to do?? UPDATE: I am writing to the database with the text urlencoded: htmlentities (urlencode($_POST['postmessage'])); I am using: <?php echo htmlentities (urldecode($row['...

SimplePie Encoding

I am using SimplePie to parse and display an xml feed on my site. I have two separate rss feeds and I running each one through SimplePie then displaying them in the side bar. The problem I am having is that each feed contains smart quotes and they are displayed as odd characters in the browser. SimplePie has the encoding set as UTF-8,...

Russian language in e-TextEditor or Cygwin

I'm using e-TextEditor for some tasks and can't figure, why when i using some Russian text and process it in bundle script i'm always getting something like http://gyazo.com/f38c69babe1f95ff786711fe684aee77.png . I'm think this is cygwin bug, because webkit must render it correct in UTF-8 encoding. I'm tested some guides thats describes ...

perl2php, +mysql string encoding (+CodeIgniter)

Seriously, I'm lost in the UTF-8 world. Here is my situation (everything is happening on a mac): I get a web service response with perl+lwp and store it in mysql database; response is encoded in UTF-8 and I use DBI module to store data in Mysql UTF-8 table (urf8_general_ci encoding); when I get strings from database with CI model; outp...

Why can't I get rid of this Â&nbsp;?

Each line is a string Â&nbsp;4 Â&nbsp;minutes Â&nbsp;12 Â&nbsp;minutes Â&nbsp;16 Â&nbsp;minutes I was able to remove the  successfully using str_replace but not the HTML entity. I found this question: http://stackoverflow.com/questions/657643/how-to-remove-html-special-chars-in-php But the preg_replace did not do the job. How can ...

Unable to create a file with foreign language characters

I get the following error, when trying to save a properties file (containing name/value pairs) with foreign language characters. How do I set the encoding Save could not be completed. Some characters cannot be mapped using "Cp1252" character encoding. Either change the encoding or remove the characters which are not supported by the "C...

How to ensure all VS code files are in UTF-8?

Is there a way to ensure all code files in my Visual Studio solution are encoded in UTF-8? I'd prefer this done automatically rather than by hand. Thanks! ...

Character/URI encoding in JavaScript getting out of sync?

I have a question about encoding special/extended UTF-8 characters in URLs in JavaScript. The same question applies to many characters like the Registered R-circle, but my example uses an umlaut: ü = %C3%BC in UTF-8 (four rows from bottom of http://www.utf8-chartable.de/) If the url contains an umlaut represented as UTF-8 (ü = %C3%BC),...

Iconv is converting to UTF-16 instead of UTF-8 when invoked from powershell

I have a problem while trying to batch convert the encoding of some files from ISO-8859-1 to UTF-8 using iconv in a powershell script. I have this bat file, that works ok: for %%f in (*.txt) do ( echo %%f C:\"Program Files"\GnuWin32\bin\iconv.exe -f iso-8859-1 -t utf-8 %%f > %%f.UTF_8_MSDOS ) I need to convert all files on the d...

Smart way to find out string encoding?

I wonder whether it is possible to find what is the encoding of string? I know that it may be impossible for some strings (e.g. that do not have non-ASCII characters). Maybe it is possible to obtain a list of encodings that may be correct (possible) for a given string? I'm looking for some other way than trying to decode/encode and wait...

how to avoid encoding problems using ajax-json and php-postrgesql

hey all together, i have problems with encoding when using json and ajax. chrome and ie encode umlauts as unicode when jsonifying, firefox and safari returning those utf-8 escaped umlauts like ¼Ã. where is the best place to give all the same encoding? js / php-get or by writing them to the database. and i think the next trouble is, wh...

.docx to html friendly text

Hi, I need a way to strip the uncompatible characters in the .doc/.docx files my clients send me for content. Right now I've been relying on find/replace which is really annoying. How do you take your .doc/.docx and convert them into html friend text? thank you! Here are some of the special characters that are messing up... ” - “...