Questions tagged [utf-7]

Obsolete 7-bit Unicode character encoding

UTF-7 is an obsolete transformation format that uses only ASCII characters. It was intended for use with MIME, but is no longer needed with 8-bit-clean channels. Due to serious disadvantages, it was never standardized.

22 questions
14
votes
4 answers

IMAP folder path encoding (IMAP UTF-7) for Python

I would like to know if any "official" function/library existed in Python for IMAP4 UTF-7 folder path encoding. In the imapInstance.list() I get the following path IMAP UTF-7 encoded : '(\\HasNoChildren) "." "[Mails].Test&AOk-"', If I do the…
Mibou
  • 936
  • 2
  • 13
  • 25
13
votes
3 answers

Adding "charset" to all ASP.NET MVC HTTP responses

Is there an easy way to specify all "normal" views is an ASP.NET MVC app are to have charset=utf-8 appended to the Content-Type? View() lacks an override that allows you to specify the Content-Type, and ActionResult and friends don't seem to expose…
Benjamin Pollack
  • 27,594
  • 16
  • 81
  • 105
8
votes
2 answers

Loading a Java Charset manually

I'm doing some work using the JavaMail API, and I've run across encodings which Java doesn't support natively (by design), such as UTF7/unicode-1-1-utf-7. For that encoding in particular I found the JUTF7 implementation of a Java Charset and…
Keeblebrox
  • 382
  • 4
  • 16
6
votes
3 answers

IMAP folder path encoding (IMAP UTF-7) for .NET?

The IMAP specification (RFC 2060, 5.1.3. Mailbox International Naming Convention) describes how to handle non-ASCII characters in folder names. It defines a modified UTF-7 encoding: By convention, international mailbox names are specified using…
splattne
  • 102,760
  • 52
  • 202
  • 249
3
votes
1 answer

Intelligent UTF-8 to UTF-7 in .NET

If I have a string of UTF-8 characters and they need to be output to an older system as UTF-7 I have two questions pertaining to this. How can I convert a string s which has UTF-8 characters to the same string without those characters…
maxfridbe
  • 5,872
  • 10
  • 58
  • 80
2
votes
3 answers

Java Convert 7bit Charset Octets to Readable String (From PDU SMS)

I'm receiving SMS from GSM modem in PDU format; the TP-User-Data is "C8329BFD06DDDF72363904" and what I get is: "�2����r69", while the sent sms is "Hello World!". Here is my java code: private String fromPDUText(String PDUSMSText) { String…
YasharHND
  • 123
  • 1
  • 3
  • 13
2
votes
1 answer

Python 2.7.3 UTF-8 Encoding Irreversible

I've come across a few very troublesome strings while crawling the web. In particular, a page advertises as being UTF-7, and though it's not quite UTF-7 that doesn't appear to be the issue. I'm not concerned with representing the exact intent of the…
Dan Lecocq
  • 3,383
  • 25
  • 22
2
votes
0 answers

iOS UTF7 encoding/decoding

I have an issue with UTF7 decoding. I was able to isolate the problem, creating the following sample code: NSStringEncoding stringEncoding = myFunctionForTranslateCodepageToEncoding(codePage); // see the end of the string, it's important const char…
Marcin
  • 1,823
  • 3
  • 16
  • 18
1
vote
2 answers

Why is UTF-7 interpreting umlauts correct and UTF-8 not?

I have a Base64 string which I want to convert and decode to UTF-8 like this: byte[] encodedDataAsBytes = System.Convert.FromBase64String(vcard); return Encoding.UTF8.GetString(encodedDataAsBytes); This because Umlauts in the string need to be…
1
vote
1 answer

File.ReadAllText with UTF-7 ignoring + characters

I have a file on the disk that has been written by the program, with some data encoded in Json. I am using C#'s File.ReadAllText(string path, Encoding encoding) to read it later. For unrelated reasons, we have to work with UTF-7. Our lines then…
Kaito Kid
  • 983
  • 4
  • 15
  • 34
1
vote
2 answers

Utf7Encoding Text truncation

I was having an issue with the Utf7Encoding class truncating the '+4' sequence. I would be very interested to know why this was happening. I tried Utf8Encoding for getting string from the byte[] array and it seem to work honky dory. Are there any…
dexter
  • 7,063
  • 9
  • 54
  • 71
1
vote
1 answer

How to convert a regular string format (ascii?) to UTF-7 in JavaScript or Java?

So I'm trying to understand how a special character normally seen as '<' could be converted to '+ADw-' in UTF-7. Is there an online tool or a built in library in JavaScript or Java that can do this? What is the math behind this? I know that UTF-7…
eternalminerals.com
  • 395
  • 1
  • 4
  • 14
1
vote
1 answer

Maximum size in bytes of single 16 bit character in UTF-7 representation

What would be maximum size in bytes of single UTF-16 character (2-byte character i.e. char type in .NET) saved in UTF-7 format? This is what I've found on Wikipedia: 5 for an isolated case inside a run of single byte characters. For runs 2 2⁄3…
Pol
  • 5,064
  • 4
  • 32
  • 51
1
vote
1 answer

How to decode utf-7 in wp8

Windows Phone 8 does not support UTF-7. Is there any way to decode UTF-7 like in the following .NET code? Encoding.UTF7.GetString(bytes);
winstead
  • 11
  • 3
1
vote
0 answers

How do I find mail messages in an inbox with UTF-7 character encoding

We have a script that moves messages from an inbox into a CRM against the contact record of the sender (nice one CiviCRM!) It has stopped working because someone has sent us a message in UTF-7 encoding, and the script can't or won't convert it to…
1
2