utf-7

Adding “charset” to all ASP.NET MVC HTTP responses

旧街凉风 提交于 2020-01-22 11:03:31
问题 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 anything, either. The motivation is obviously to work around Internet Explorer guessing the "correct" encoding type, which I in turn want to do to avoid UTF-7 XSS attacks. 回答1: Maybe this in your web.config will do the magic? <configuration>

Adding “charset” to all ASP.NET MVC HTTP responses

巧了我就是萌 提交于 2020-01-22 11:02:29
问题 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 anything, either. The motivation is obviously to work around Internet Explorer guessing the "correct" encoding type, which I in turn want to do to avoid UTF-7 XSS attacks. 回答1: Maybe this in your web.config will do the magic? <configuration>

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

一个人想着一个人 提交于 2020-01-02 02:45:06
问题 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 following encoding : (u"[Mails].Testé").encode('utf-7') I get : '[Mails].Test+AOk-' Which is UTF-7 but not IMAP UTF-7 encoded. Test+AOk- instead of Test&AOk- I'd need an official function or library to get the IMAP UTF-7 encoded version. 回答1: The

File.ReadAllText with UTF-7 ignoring + characters

♀尐吖头ヾ 提交于 2019-12-12 05:52:17
问题 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 looks like this: var content = File.ReadAllText(fileName, Encoding.UTF7); It works fine, writing then reading, for basically everything we need. The only exception is the plus sign (+). If there is a + sign in our file, this code returns the entire

PHP, IMAP and Outlook 2010 - folder names encoding is different?

醉酒当歌 提交于 2019-12-11 07:16:24
问题 Im developing e-mail client in php (with symfony2) and i have problem with folders with non-ascii characters in name. Folder created in php app is visible in same app correctly. Same in Outlook, created in outlook looks good in outlook. In other cases not. Folder created in outlook is not displayed correctly in php and vice-versa. Im using utf-7 to encode folder names in php. Which encoding uses Outlook? Example: Folder named "Wysłąne" (misspelled polish word meaning "sent"), first one is

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

白昼怎懂夜的黑 提交于 2019-12-07 14:20:03
问题 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 a modified version of the UTF-7 encoding described in [UTF-7]. The purpose of these modifications is to correct the following problems with UTF-7: UTF-7 uses the "+" character for shifting; this conflicts with the common use of "+" in mailbox names, in

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

╄→尐↘猪︶ㄣ 提交于 2019-12-05 21:37:45
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 a modified version of the UTF-7 encoding described in [UTF-7]. The purpose of these modifications is to correct the following problems with UTF-7: UTF-7 uses the "+" character for shifting; this conflicts with the common use of "+" in mailbox names, in particular USENET newsgroup names. UTF-7's encoding is BASE64 which uses the "/" character; this

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

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 05:08:25
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 following encoding : (u"[Mails].Testé").encode('utf-7') I get : '[Mails].Test+AOk-' Which is UTF-7 but not IMAP UTF-7 encoded. Test+AOk- instead of Test&AOk- I'd need an official function or library to get the IMAP UTF-7 encoded version. Menno Smits The IMAPClient package has functionality for encoding and decoding using IMAP's modified UTF-7. Have a look

Adding “charset” to all ASP.NET MVC HTTP responses

Deadly 提交于 2019-12-03 05:48:22
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 anything, either. The motivation is obviously to work around Internet Explorer guessing the "correct" encoding type, which I in turn want to do to avoid UTF-7 XSS attacks. Mickel Maybe this in your web.config will do the magic? <configuration> <system.web> <globalization requestEncoding="utf-8" responseEncoding="utf-8" /> </system.web> <

Loading a Java Charset manually

走远了吗. 提交于 2019-11-28 00:10:18
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 CharsetProvider for UTF7. However, having added the jutf7.jar to my classpath I still get UnsupportedEncodingException s, and unicode-1-1-utf-7 is definitely one of JUTF7's aliases. Is there a way to manually load the Charset or ensure that the Charset is being loaded so that I can rule that out as a cause? There's a bit more to using a new Charset, apart