Tuesday, November 29, 2011

br2nl

    public function br2nl($string)
    {
        return preg_replace('/\<br(\s*)?\/?\>/i', "\n", $string);
    }

Thursday, November 24, 2011

Math Functions in JavaScript

JavaScript supports many arithmetic operations as well as the following math functions (or, more precisely, methods of the Math object):

Math.abs(a)     // the absolute value of a
Math.acos(a)    // arc cosine of a
Math.asin(a)    // arc sine of a
Math.atan(a)    // arc tangent of a
Math.atan2(a,b) // arc tangent of a/b
Math.ceil(a)    // integer closest to a and not less than a
Math.cos(a)     // cosine of a
Math.exp(a)     // exponent of a (Math.E to the power a)
Math.floor(a)   // integer closest to a, not greater than a
Math.log(a)     // log of a base e
Math.max(a,b)   // the maximum of a and b
Math.min(a,b)   // the minimum of a and b
Math.pow(a,b)   // a to the power b
Math.random()   // pseudorandom number 0 to 1 (see examples)
Math.round(a)   // integer closest to a (see rounding examples)
Math.sin(a)     // sine of a
Math.sqrt(a)    // square root of a
Math.tan(a)     // tangent of a

Note that trigonometric functions assume that the argument is in radians, not degrees!

Wednesday, November 23, 2011

Jquery extruder

A good way to have extra content or a navigation tool in your page!

This jquery component let you easly build a sliding panel where to insert any kind of content; it has builtin all the functionalities for managing menu lines and sub panels with accordion effect. It can get the content via ajax and therefore you can dynamically build it by passing DATA via request using the metadata attribute settable on the extruder container.


Demo: http://pupunzi.com/mb.components/mb.extruder/demo/demo.html
Download: https://github.com/downloads/pupunzi/jquery.mb.extruder/jquery.mb.extruder.2.3.zip
Doc: https://github.com/pupunzi/jquery.mb.extruder/wiki/

Tuesday, November 22, 2011

Ffmpeg: Convert mp4 to mov

To convert mp4 movie into mov movie the following command can be used:
ffmpeg -i input_file.mp4 -acodec copy -vcodec copy -f mov output_file.mov

Zend Mail 2.0 to be delivered for upcoming ZF2 beta2

The work under new Zend Mail 2.0 component has been started recently. Matthew Weier O'Phinney created the architectural outline of proposed object relations and interactions. That document can be found under following Wiki page: "RFC - Mail Refactoring"

Mail goals that should be addressed in new Zend Mail component are:

  • handing of mass messaging
  • better separation between message handing and transport
  • improved MIME-types encoding and Unicode support
  • more intuitive handing of attachments and custom message headers
Feel free to provide your comments under the appropriate Wiki page according the proposed architecture.

Revised version of Zend Mail 2.0 is planed to be delivered for upcoming Zend Framework 2 beta2 release.

HTML5 port of Quake II game engine

Wow! A group of googlers developed a HTML 5 based port of id Software‘s Quake II. So, we can play Quake II in a common web browser (well, just Safari and Chrome for now) without any plug-ins. You can read about the project on Google Web Toolkit Blog, watch a demo on YouTube or get the code on the project page on Google Code.

LimeJS, HTML5 game framework

LimeJS is a HTML5 game framework for building fast, native-experience games for all modern touchscreens and desktop browsers. Its goal, according to the creators, is quite clear and simple: to provide an easy way to build good game experience without thinking about inner workings.
Check LimeJS‘s official site or its GitHub repository.

Thursday, November 17, 2011

Improved scroll bar for your website


Improved scroll bar for your website LiimeBar is a jQuery plugin which removes the default browser scroll bar and replaces it with a sleek, modern one which will really impress your visitors and enhance your website.
The scroll bar is pure CSS which makes it very customizable and you will have it up and running in no time at all (approx. 2 minutes).

Demo & Download : http://www.liime.net/projects/liimeBar/demo.html

Jquery PW Typer



jquery PW Typer is a jQuery plugin that seeks to mimic the look of letters being typed on the page like a typewritter. It’s very easy to use, yet customizable, and it even works with HTML content.

Documentation & Demo : http://philipwalton.com/2011/07/04/pw_typer/
Source code on GitHub : https://github.com/philipwalton/PW_Typer

Zend Framework getParam from view or model

// Get Param

$request = Zend_Controller_Front::getInstance()->getRequest();
$curr_language = $request->getParam('lang');

// Set Param
$request->setParam('lang','en');

Jquery 1.7 .on()

The .on() method attaches event handlers to the currently selected set of elements in the jQuery object. As of jQuery 1.7, the .on() method provides all functionality required for attaching event handlers. For help in converting from older jQuery event methods, see .bind(), .delegate(), and .live(). To remove events bound with .on(), see .off(). To attach an event that runs only once and then removes itself, see .one()


Documantation: http://api.jquery.com/on/

Tuesday, November 8, 2011

Jquery drag events

1. Basic Drag

$('#demo2_box')
       
.bind('drag',function( event ){
                $
( this ).css( event.shiftKey ? {
                        top
: event.offsetY } : {
                        left
: event.offsetX
                       
});
               
});


2. Axis Drag

$('#demo2_box')
       
.bind('drag',function( event ){
                $
( this ).css( event.shiftKey ? {
                        top
: event.offsetY } : {
                        left
: event.offsetX
                       
});
               
}); 


3. Grid Drag

$('#demo3_box')
       
.bind('drag',function( event ){
                $
( this ).css({
                        top
: Math.round( event.offsetY/20 ) * 20,
                        left
: Math.round( event.offsetX/20 ) * 20
                       
});
               
}); 


 
4. Handle Drag

$('#demo4_box')
       
.bind('dragstart',function( event ){
               
return $(event.target).is('.handle');
               
})
       
.bind('drag',function( event ){
                $
( this ).css({
                        top
: event.offsetY,
                        left
: event.offsetX
                       
});
               
});  

 
5. Active Drag

$('#demo5_box')
       
.bind('dragstart',function( event ){
               
if ( !$(event.target).is('.handle') ) return false;
                $
( this ).addClass('active');
               
})
       
.bind('drag',function( event ){
                $
( this ).css({
                        top
: event.offsetY,
                        left
: event.offsetX
                       
});
               
})
       
.bind('dragend',function( event ){
                $
( this ).removeClass('active');
               
}); 



 6. Proxy Drag

$('#demo6_box')
       
.bind('dragstart',function( event ){
               
if ( !$(event.target).is('.handle') ) return false;
               
return $( this ).css('opacity',.5)
                       
.clone().addClass('active')
                       
.insertAfter( this );
               
})
       
.bind('drag',function( event ){
                $
( event.dragProxy ).css({
                        top
: event.offsetY,
                        left
: event.offsetX
                       
});
               
})
       
.bind('dragend',function( event ){
                $
( event.dragProxy ).remove();
                $
( this ).animate({
                        top
: event.offsetY,
                        left
: event.offsetX,
                        opacity
: 1
                       
})
               
}); 



7. Circular Drag

$('#demo7_box')
       
.bind('dragstart',function( event ){
               
var data = $( this ).data('dragcircle');
               
if ( data ) data.$circle.show();
               
else {
                        data
= {
                                radius
: 200, $circle: $([]),
                                halfHeight
: $( this ).outerHeight()/2,
                                halfWidth
: $( this ).outerWidth()/2
                               
};
                        data
.centerX = event.offsetX + data.radius + data.halfWidth,
                        data
.centerY = event.offsetY + data.halfHeight,
                       
// create divs to highlight the path...
                        $
.each( new Array(72), function( i, a ){
                                angle
= Math.PI * ( ( i-36 ) / 36 );
                                data
.$circle = data.$circle.add(
                                        $
('<div class="point" />').css({
                                                top
: data.centerY + Math.cos( angle )*data.radius,
                                                left
: data.centerX + Math.sin( angle )*data.radius,
                                               
})
                                       
);
                               
});
                        $
( this ).after( data.$circle ).data('dragcircle', data );
                       
}
               
})
       
.bind('drag',function( event ){
               
var data = $( this ).data('dragcircle'),
                angle
= Math.atan2( event.pageX - data.centerX, event.pageY - data.centerY );
                $
( this ).css({
                        top
: data.centerY + Math.cos( angle )*data.radius - data.halfHeight,
                        left
: data.centerX + Math.sin( angle )*data.radius - data.halfWidth
                       
});
               
})
       
.bind('dragend',function(){
                $
( this ).data('dragcircle').$circle.hide();
               
}); 




http://threedubmedia.com/demo/drag/

Jqyery setTimeout

setTimeout(function(){
      // do something
},800);

Monday, November 7, 2011

Javascript Equivalent to Php Explode

var mystr = '0000000020C90037:TEMP:data';
var myarr = mystr.split(":");
var myvar = myarr[1] + ":" + myarr[2];

IE position fix


Fixed Content using CSS/ Dynamic Expressions

CSS lets you position content on your page in a variety of ways, one of which is "fixed". In this mode a piece of content remains completely static without so much as a flinch when the rest of the page is scrolled. One of my predictions for the year 2007 is the eruption of this effect on the web as the majority of visitor browsers support it natively using CSS.
In the following tutorial, I'll discuss how to use "fixed" positioning in CSS, plus how to simulate the behaviour in IE5/6 using Dynamic Expressions, which does not support the direct CSS approach. Shall be begin?

 

Fixed Content using CSS


There' really only one authentic way of creating fixed content that doesn't scroll on the page, and that's through CSS "fixed" positioning. Like "absolute" positioning, "fixed" places a piece of content outside the normal flow of the document using an explicit x (horizontal) and y (vertical) coordinate system. However, with "fixed", its coordinate system is relative to the viewpoint of the browser, so "5px" vertically for example means "5px" down from the upper left corner of the viewable window, regardless of whether the page is scrolled or not.

<style type="text/css">

#mydiv{
position: fixed;
left: 10px;
top: 50px;
}

</style>

<div id="mydiv">
Some content here
</div>

Remember, in fixed positioning, the left and top values are relative to the upper left corner of the window viewpoint, which automatically changes as the page is scrolled. This creates the static effect.

 

Fixed Content in IE (5 & 6) via Dynamic Expressions


We can always count on IE to make things more 'interesting" for web developers. In IE6 and below, CSS "fixed" positioning isn't supported (note that IE7 does). In order to realistically implement fixed content, we need a no-fuss way to simulate the effect in IE6 (and perhaps IE5). Dynamic expressions, a IE proprietary feature, fits the bill:
<style type="text/css">

#mydiv{
position: fixed;
left: 10px;
top: 50px;
}

* html #mydiv{ /*IE6 only rule, applied on top of the default above*/
position: absolute;
top: expression(document.compatMode=="CSS1Compat"? document.documentElement.scrollTop+50+"px" : body.scrollTop+50+"px");
}

</style>

<div id="mydiv">
Some content here
</div>

Take a look at the highlighted CSS rule. It's targeted exclusively towards IE5 and 6 by way of the Star (*) html hack, and is what will help us simulate fixed positioning in legacy IE5/6 browsers. First, I override the default "position: fixed" declaration with something IE understands, "position: absolute". Then, by using dynamic expressions, I get its "top" attribute to automatically update itself so it's always "50px" below the upper left viewpoint of the browser window:

top: expression(document.compatMode=="CSS1Compat"? document.documentElement.scrollTop+50+"px" : body.scrollTop+50+"px");

Now, even if you're familiar with IE's dynamic expressions in general, the above line may still look somewhat confusing- why the conditional operator inside it and two different value settings accordingly? Well, depending on whether your page contains a valid doctype declaration at the very top or not, the syntax to referencing certain measurement properties of the body in IE, such as the "scrollTop" property, differs slightly. The above dynamic expression takes into account both possibilities. Note that I've left out setting the "left" property as a dynamic expression as well in IE, making a leap of faith that the page doesn't contain any horizontal scrollbars to warrant this property being dynamic. However, if you wanted to declare it, it would look something like:

left: expression(document.compatMode=="CSS1Compat"? document.documentElement.scrollLeft+10+"px" : body.scrollLeft+10+"px");

In any event, the end result is a DIV that stays static on the page in all the major browsers, albeit with some hesitance in IE5/6 in that the effect isn't 100% smooth due to it being simulated programmically. But it's an acceptable compromise, and helps overcome the main mental hurdle to using "position: fixed" on our pages!
After thinking my website worked perfect on all browsers, IE8 came along and ruined it!! I can't wait for the day that Microsoft are banned from developing web browsers. The common CSS for centering a DIV on IE8 as shown below doesn't work:

#container{
margin:0 auto;}

To solve this you need the following CSS:


<!--[if (IE 6) | (IE 7) | (IE 8)]>
<style type="text/css">

body{
text-align: center;}

#container{
margin:0 auto;
text-align:left;
}
</style>
<![endif]-->


Using text-align: center; centers the DIV for IE, and the text-align: left; margin: 0 auto; will align the text to the left, and center the DIV for other browsers.

Wednesday, November 2, 2011

What is MIME?

The MIME standard consists of the definition of a few new message headers, which indicate what sort of content is in a message -- what content type (plain text, HTML, graphics, etc.) and how it's encoded. Some of the content types are "multipart", meaning that they define a complex message structure with more than one part, each of which has headers of its own. These parts can be nested in arbitrarily complex ways, allowing for an enormous degree of versatility in expressing structured data within an e-mail message. As we'll see later when multipart messages are described, each part has its own set of MIME headers, in addition to the headers at the beginning of the message.
MIME not only revolutionized e-mail, it was also adopted as a major part of the World Wide Web; the HTTP protocol uses many of the same MIME headers as e-mail messages.

The MIME Headers


Here are the headers used in a MIME message.

 

MIME-Version


This must always be present in any MIME message, and the only recognized value for it is 1.0. It indicates the version of the MIME standard that is in use, of which only one exists so far. Since the present MIME standard permits a great degree of extensibility through the definition of new content types, subtypes, encodings, and the like, it's unlikely that any other MIME version will ever need to be defined, and doing so would necessarily break compatibility with all existing mail programs (the standards explicitly say that they can't give any guidance on what a MIME-1.0-compliant program ought to do if it encounters a hypothetical MIME 1.1 or MIME 2.0 message, so it's probably best off throwing up its hands and giving up on it).
Since parenthesized comments are permitted in message headers, the following is a valid Mime-Version header:

MIME-Version: 1.0 (produced by FooSoft 4.5)

 

Content-Type

 

This header defines what type of data is being sent, using what is known as "MIME types". A MIME type is a string that identifies a data format. MIME types always have a slash in them, separating a major type from a subtype. For instance, image/jpeg is the MIME type for JPEG images, where the major type is image (other major types are text, audio, video, application, message, and multipart), and the subtype is jpeg (identifying the specific format). Plain text is text/plain, while HTML is text/html. A registry list gives the current "official" MIME types, but some unofficial ones are used too; unofficial and experimental types can be used with names beginning with x-, which signifies a type that's not actually registered. In some cases MIME types without any x- have been popularized despite not appearing on the official list; this is against the standards, but some of these types are in such widespread use that it's impossible to avoid them. These include text/javascript and audio/wav.
Text-based types, like text/plain and text/html, can also have a charset parameter indicating what character encoding is in use, like this:
Content-type: text/plain; charset=iso-8859-1
In this case, the ISO-8859-1 (Latin-1) character set is specified, giving a character range that includes many accented letters in addition to the normal ASCII characters.

Content-Transfer-Encoding


Since e-mail messages (including MIME messages) are still supposed to be limited to the characters in the ASCII set, to ensure compatibility with programs that might not be able to handle anything else, any non-ASCII things (including text with other characters and binary files) needs to be encoded in a manner that can be transmitted in plain ASCII. Two encodings are defined in the MIME standards, base64 and quoted-printable, with base64 being more appropriate for binary data and quoted-printable for text data. I mention these encodings more in the file attachments and character sets pages. When a transfer encoding is used, it's noted in the Content-Transfer-Encoding header:

Content-Transfer-Encoding: quoted-printable

 

Content-ID


The Content-ID header is primarily of use in multi-part messages (as discussed below); a Content-ID is a unique identifier for a message part, allowing it to be referred to (e.g., in IMG tags of an HTML message allowing the inline display of attached images). The content ID is contained within angle brackets in the Content-ID header. Here is an example:

Content-ID: <5.31.32252.1057009685@server01.example.net>
 
The standards don't really have a lot to say about exactly what is in a Content-ID; they're only supposed to be globally and permanently unique (meaning that no two are the same, even when generated by different people in different times and places). To achieve this, some conventions have been adopted; one of them is to include an at sign, with the hostname of the computer which created the content ID to the right of it. This ensures the content ID is different from any created by other computers (well, at least it is when the originating computer has a unique Internet hostname; if, as sometimes happens, an anonymous machine inserts something generic like localhost, uniqueness is no longer guaranteed). Then, the part to the left of the at sign is designed to be unique within that machine; a good way to do this is to append several constantly-changing strings that programs have access to. In this case, four different numbers were inserted, with dots between them: the rightmost one is a timestamp of the number of seconds since January 1, 1970; to the left of it is the process ID of the program that generated the message (on servers running Unix or Linux, each process has a number which is unique among the processes in progress at any moment, though they do repeat over time); to the left of that is a count of the number of messages generated so far by the current process; and the leftmost number is the number of parts in the current message that have been generated so far. Put together, these guarantee that the content ID will never repeat; even if multiple messages are generated within the same second, they either have different process IDs or a different count of messages generated by the same process.
That's just an example of how a unique content ID can be generated; different programs do it differently. It's only necessary that they remain unique, a requirement that is necessary to ensure that, even if a bunch of different messages are joined together as part of a bigger multi-part message (as happens when a message is forwarded as an attachment, or assembled into a MIME-format digest), you won't have two parts with the same content ID, which would be likely to confuse mail programs greatly.
There's a similar header called Message-ID which assigns a unique identifier to the message as a whole; this is not actually part of the MIME standards, since it can be used on non-MIME as well as MIME messages. If the originating mail program doesn't add a message ID, a server handling the message later on probably will, since a number of programs (both clients and servers) want every message to have one in order to keep track of them. Some headers discussed in the Other Headers article make use of message IDs.
When referenced in the form of a Web URI (the term "URL" is being deprecated by the newest proposed Web standards in favor of "URI"), content IDs and message IDs are placed within the URI schemes cid and mid respectively, without the angle brackets:

cid:5.31.32252.1057009685@server01.example.net

 

Content-Description

 
Content-Description is a free-form plain text field that can be used to briefly describe the purpose of a MIME message part. Some mail programs display it along with other information about an attachment in the list of things within a message that can be saved or opened.

 

Content-Disposition


The Content-Disposition header suggests to the receiving program what should be done with a MIME message part. Acceptable values are inline, indicating that the part is intended to be displayed as a portion of a compound document (e.g., an image to be shown within an HTML document) and attachment, indicating an object to be opened or saved separately.
Parameters can be appended, separated by a semicolon from the main value; the most common parameter is filename, which allows you to suggest what name the file should be saved as. (The destination program might not necesarily save it under this name, however; it could be an invalid name under the naming conventions of the destination operating system, and also the end user generally gets a chance to type or select a filename for saving regardless of what the MIME headers suggest.)
A sample Content-Disposition header:

Content-Disposition: attachment; filename="test.jpg"

 

Multipart MIME Message Bodies


As has been mentioned, the MIME types starting with multipart define structures that contain multiple parts. The most commonly used varieties are multipart/alternative, which indicates that each part is a different version of the same document (e.g., one version in text form and one in HTML) and the viewer ought to pick one and display it; multipart/related, which indicates that the parts form a larger unit intended to be displayed together (e.g., an HTML document and its inline images); and multipart/mixed, indicating a "mixed bag" of different types of data, probably intended to be separately opened and/or saved. Another MIME type that can have a complex structure is message/rfc822, which contains an entire e-mail message (this is what's used when you forward a message as an attachment); this message may, in turn, have the MIME features that allow it to contain multiple parts itself, even though message/rfc822 isn't actually in the "multipart" MIME type group itself. A compilation of multiple messages into a structured digest would use the type multipart/digest. A PGP-signed message (using encryption to authenticate its sender) might be sent as a multipart/signed structure, but some mail programs (e.g., Outlook Express) don't like that and end up showing a completely blank message... not very nice.
A multipart unit has some special parameters in its Content-Type header:

Content-Type: multipart/related;
 boundary="----=_NextPart_32252.1057009685.31.001";
 type="multipart/alternative"

The boundary parameter gives a string that's used to mark the boundary between parts of the document.
It needs to be some sequence of characters that doesn't occur elsewhere in the document -- including in the boundary
markers of any nested multipart units within it.  For this reason, boundary strings should be generated to be globally
unique like message and content IDs (you never know what messages might get forwarded as an attachment to other messages,
so you don't want to reuse the same boundary strings in different messages), and should contain a sufficiently unusual
combination of numbers, letters, and punctuation characters that it's extremely unlikely to come up by chance in the
text of the message itself.

The type parameter gives the MIME type of the main part within the multipart group; it's used when one of the parts is the main message body and the rest are auxiliary things like attachments or images. In this case, the main part type is yet another multipart group, nested within the first one; the outer multipart group consists of the message body and its related items, while the inner one consists of the alternative (plain text and HTML) versions of the body.
After the message headers, and the blank line that terminates the headers, the multipart message continues like this:

This is a multi-part message in MIME format.

------=_NextPart_32252.1057009685.31.001
Content-Type: multipart/alternative;
 boundary="----=_NextPart_32252.1057009685.31.002"
Content-Description: Message in alternative text and HTML forms


------=_NextPart_32252.1057009685.31.002
Content-Type: text/plain;
 charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Description: Message in plain-text form

Some plain text goes here.

First comes the line that says "This is a multi-part message in MIME format.", for the benefit of any
non-MIME-capable reader who might be wondering what the message is.  Then comes the boundary marker, as defined
in the headers; you may note that it begins here with six dashes while the definition had only four; that's because
the standards call for the boundary to be preceded by two dashes.

The boundary marker is followed by the MIME headers for the next part; it's unnecessary to include the Mime-Version header (it appears only once in the main message headers), but each part has a content type and possibly a description, transfer encoding, and disposition.
If a part is itself a multipart entity, it has its own boundary marker (which must be different from the outer one; note here that the inner boundary ends in "002" while the outer one ended in "001"). The parts of the inner multipart unit follow; here, we see the beginning of a plain text portion. The end of that part and the beginning of the next one looks like this:

More plain text goes here.

------=_NextPart_32252.1057009685.31.002
Content-Type: text/html;
 charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Description: Message in HTML form

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
 "http://www.w3.org/TR/html40/strict.dtd">
<html>
<!-- HTML code goes here -->

Once all parts are complete, the end is marked with a boundary marker followed immediately by two more dashes,
at which point the outer multipart group resumes with its next part:

</html>

------=_NextPart_32252.1057009685.31.002--

------=_NextPart_32252.1057009685.31.001
Content-Type: image/gif
Content-Transfer-Encoding: base64
Content-Description: Graph
Content-Disposition: inline; filename="image.gif"
Content-ID: <1.31.32252.1057009685@server01.example.net>

The end of the message is signalled by a top-level boundary marker, two dashes, and then -- End -- on
a line by itself:

------=_NextPart_32252.1057009685.31.001--


-- End --

 

Non-ASCII Characters in Headers


The MIME standards also provide a way to get characters outside the ASCII set into the headers themselves, which is useful for people whose names include accented letters, for instance. Unfortunately, such headers look like a mess when viewed in raw mode:
=?iso-8859-1?Q?l'=E9te_c'est_arrive=E9!?=
 
By the standard, an "encoded word" is a sequence of characters that begins with "=?", ends with "?=", and has two "?"s in between. (That means that this sequence of characters had better not occur accidentally in a header, or else it'll be interpreted as an encoded word by MIME-compatible programs.) After the first question mark is the name of the character encoding being used; after the second question mark is the manner in which it's being encoded into plain ASCII (Q=quoted printable, B=base64); and after the third question mark is the text itself.
The above format for encoding special characters is the one specified in RFC 2047. However, it has some drawbacks such as the lack of any means of specifying particular encoding information for parameters such as filenames that are appended to MIME headers. For this, a newer and more versatile format was specified later in RFC 2231, which supports providing encoding and language code information for each parameter, and breaking up of such parameter values to multiple lines (often necessary when special characters are used which require lengthy encoding sequences). This looks like:

Content-Type: application/x-stuff
   title*0*=us-ascii'en'This%20is%20even%20more%20
   title*1*=%2A%2A%2Afun%2A%2A%2A%20
   title*2="isn't it!"
 
This format, using asterisks following the name of the parameter, has a sequential number (0, 1, 2) indicating that the lines are part of the same parameter, then has an encoding (us-ascii), a language code (en for English), and the encoded value, all separated by single quotes.
Unfortunately, many mail programs still fail to support this "new" (even though about a decade old by now) format, and will fail to correctly parse the filename. This has led some developers to cause programs to output filenames in standards-noncompliant formats that nevertheless work in commonly used programs, when special characters are needed.

 

Links