Chinese ID3 garbled problem MX solution

Source: Internet
Author: User
Tags id3
Solve | problem | Chinese

For the cloud open with AS2 to solve the onID3 of garbled made a little bit of improvement, can be used in MX

Changes:

-Encapsulate a class into a simple function
-Before and after the operation does not change the original System.usecodepage value

Code:

function Ansi2utf (ansi_string) {
var temp =! (! System.usecodepage);
System.usecodepage = true;
var code = "";
for (var i = 0; i<ansi_string.length; i++) {
Code + = "%" +ansi_string.charcodeat (i)-toString (16);
}
var result = unescape (code);
System.usecodepage = temp;
return result;
}

Use examples:

My_sound = new sound ();
MY_SOUND.ONID3 = function () {
var songname = Ansi2utf (this.id3.songname);
Trace ("Result:" +songname);
};
My_sound.loadsound ("Music.mp3", false);

In addition, there is a phrase in Flash help:

Set the System.usecodepage property only once in the document, not to allow the player to interpret some external files as Unicode and to interpret other files as other encodings, and to use the property multiple times, because this can produce unpredictable results.

It seems that this function may bring hidden problems, as to what exactly is the problem, I have not yet encountered. There are other ways to solve mp3id3 garbled problems, such as establishing UTF-8 and GB2312/BIG5 encoded images, and so on, but none of this is simple.

The existing problems:

-can only convert local encoding to UTF-8, that is: Simplified system read Traditional Chinese ID3 will still have garbled, the same traditional system is also
-can only convert ID3 V2.0, can not turn ID3 V1.0
-can only convert ID3, for more extensive txt and other external text, the conversion method still has the problem

to the forum discussion



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.