Solutions (MX Version) in the Chinese ID3 Coordinated Problem in Flash

xiaoxiao2021-03-06  41

For cloud-opening Make a little improvement, you can use, change in MX:

- Change the class into a simple Function-running without changing the original System.usePage value

Code:

Function ANSI2UTF (ANSI_STRING) {

Var Temp =! (! system.usecodepage);

System.usecodepage = true;

VAR code = "";

For (var i = 0; i

Code = "%" ANSI_STRING.CHARCODEAT (i) .tostring (16);

}

Var Result = unescape (code);

System.usecodePage = TEMP;

Return Result;

}

Use example:

my_sound = new side ();

my_sound.onid3 = function () {

Var SongName = ANSI2UTF (this.id3.songname);

Trace ("Result:" SongName);

}

My_Sound.LoadSound ("Music.mp3", FALSE);

In addition, there is such a paragraph in the Flash Help:

In the document, please only set only the system.usecode attribute; do not interpret some external files as Unicode and interpret other files as other coding, while using this property, this property is used, which will not be expected. the result of.

It seems that this function may bring hidden problems. As for what is the problem, I haven't encountered it yet. There are other ways to solve MP3ID3 garbled code, such as establishing UTF-8 and GB2312 / BIG5 encoded image forms, but there is no simplicity. Existing issues:

- can only be converted locally to UTF-8, namely: Simplified system reads traditional Chinese ID3 still there will be garbled, similar to traditional system is also

- Only convert ID3, for more extensive TXT, etc., the conversion method still exists

转载请注明原文地址:https://www.9cbs.com/read-68764.html

New Post(0)