encoding

strange codes in text, like +ADs-, +AGA-, or +ACoAKg- and +ACEAIQ-

i got a dataset that uses a strange encoding for non-printables / diacritics. i'm getting hte impression that it's an artifact of some mail system. or maybe it's excel or something? anyway, the stuff i get looks like this: +ADs-, +AGA-, or +ACoAKg- and +ACEAIQ- there's more.... any idea what that this and where it comes from? google sh...

Change Emacs Default Coding System

My problem stems from Emacs inserting the coding system headers into source files containing non-ascii characters: # -*- coding: utf-8 -*- My coworkers do not like these headers being checked into our repositories. I don't want them inserted into my files because Emacs automatically detects that the file should be UTF-8 regardless so ...

UTF-8, PHP and XML Mysql

I am having great problems solving this one: I have a mysql database encoding latin1_swedish_ci and a table that stores names and addresses. I am trying to output a UTF-8 XML file, but I am having problems with the following string: Otivägen it is being outputted as Otivägen when i vim the file. Also when opened it IE i get "An inv...

How to remove cookie with underscore in name in VB6?

I have VB6 web application and I have to remove cookie. Unfortunately cookie has underscore character in name -- exemplary cookie name looks like that: XXXXXXAAASS_session_key. When I try to remove it by assign empty value to it: Response.cookies.Item("XXXXXXAAASS_session_key") = "" I've got a new cookie with name `XXXXXXAAASS%5Fsess...

Different Layouts in IE8 on Different Web Servers

Last night, I experienced a strange behavior in IE8 as I saw two noticeably different layouts of a page that's being hosted on separate servers. On my local web server, the header markup looked as expected with its left aligned logo and right aligned and stacked utility links, all of which displayed on a centered page. On a staging web...

Encoding problems with Apache Velocity include

I have a velocity/html file. I'm trying to include/parse some simple HTML into a page. If I just copy the text directly on the the main file, it works fine: Miranda Kerr hasn’t been a Victoria’s Secret Angel for ... If I create a separate VM file, and include it like so: #parse("topicoftheday/homepagenews.vm") I get bad chara...

re: UTF-8, PHP and XML Mysql

This is relating to http://stackoverflow.com/questions/1791082/utf-8-php-and-xml-mysql, which I am still trying to get my head around. I Have a couple of separate questions that will hopefully help me understand how to resolve the issues I am having. I am trying to read values from a database and output into a file in UTF-8 format. But...

[PHP] Translating IMAP body based on their encoding

Hi all, From the manual, I know that there are 6 different transfer encoding in IMAP. At this point, I've created this basic function: function translate_imap_body($body, $encoding) { switch($encoding) { case 0: return $body;break; case 1: return $body;break; case 2: return $body;break; case 3: return base64_decode($body);br...

how to encode the ciphertext

the file abc.txt has several lines of ciphertext. i want to encode the line of ciphertext into hex encode or base64 before putting in string srr . is there any way i can do it ? bufferedReader = new BufferedReader(new FileReader("abc.txt")); String srr = null; srr = bufferedRea...

Java - Base64 string in and out of a text

I need to write string containing base64 encoded text to a text file and then later read that string back from the text file to a string variable. How can i do it so that there is no data loss due to encoding issues? ...

How do you read a text file without losing odd characters?

I would like to read a text file into an array of strings using System.IO.File.ReadAllLines. However, ReadAllLines strips out some odd characters in the file that I would like to keep, such as chr(187). I've tried some different encoding options, but that doesn't help and I don't see an option for "no encoding." I can use FileOpen and L...

Getting the original secretkey from hex format

This is the hex format of a secret key used for AES encryption 00010203050607080A0B0C0D0F101112 Can i generate the original SecretKey format or byte array from this? If so how? ...

Running a regex in GIT Bash, my file now has funny characters in it.

I ran this regex in GIT BASH (I am on a windows machine, and I have GIT installed). perl -pe 's/\[(?:xx_)?([^]]+)\]/\[\u$1\]/g' The file now looks as if it is written in Chinese (it is a .sql schema file). example: 嵛 嬀] IDENTITY(1,1) NOT NULL, Is there some encoding issue going on? ...

using NSString + stringWithContentsOfFile:usedEncoding:error:

Hello, all! I've got problem with use + stringWithContentsOfFile:usedEncoding:error: My problem in usedEncoding:(NSStringEncoding *)enc I don't know how can i set pointer to encoding. If i make it - programm is fail. For example, in similar function we have encoding:(NSStringEncoding)enc - without pointer! I want loading file (file h...

Extract files with invalid characters in filename with Python

I use python's zipfile module to extract a .zip archive (Let's take this file at http://img.dafont.com/dl/?f=akvaleir for example.) f = zipfile.ZipFile('akvaleir.zip', 'r') for fileinfo in f.infolist(): print fileinfo.filename f.extract(fileinfo, '.') Its output: Akval�ir_Normal_v2007.ttf Akval�ir, La police - The Font - Fr -...

What is the default content-type/charset?

According to this answer: http://stackoverflow.com/questions/1020892/python-urllib2-read-to-unicode I have to get the content-type in order to change to unicode. However, some websites don't have a "charset". For example, the ['content-type'] for this page is "text/html". http://bit.ly/6IcCtf/ I can't convert it to unicode. encodi...

Difference between Url Encode and HTML encode

What’s the difference between an URL Encode and a HTML Encode? ...

Displaying ® symbol in Silverlight.

Folks! I am trying to display ® and superscript TM symbols in my silverlight app. I want to save the text containing the symbols in a resx file. Things i have tried: Copy paste the ® symbol from any document to resx file. ® symbol gets displayed in the resx file. But, when running the silverlight app, xamlparseexception ...

How to control encoding when POSTing through Net::HTTP?

I'm trying to create an API wrapper for Issuu using ruby and am running into errors when attempting to POST the data. When trying a simple GET through the browser with all the params in the querystring, I am able to retrieve the expected results; however, when I try to perform the same operation using a POST in code (which the API claim...

Binary encoding for low bandwidth connections?

In my application I have a simple XML formatted file containing structured data. Each data entry has a data type and a value. Something like <entry> <field type="integer">5265</field> <field type="float">34.23</field> <field type="string">Jorge</field> </entry> Now, this formatting allow us to have the data in a human readable f...