Jump to content

weird characters -?


map200uk

Recommended Posts

Hi,

 

ive noticed sometimes i am getting some weird characters stored in my database as a result of reading an audio files tag data, such as

 

���������������

 

is there an easy way to possibly get rid of them? I was thinking regex them? altho im not sure what character it is, it appears as a [] in notepad and a triangle with a ? in the browser

 

 

Link to comment
Share on other sites

could be qoutes. ive had trouble with those. smart qoutes like microsoft puts in a word doc like a smart left qoute and right qoute, dont take up well when stored in database, maybe cause of database character set.

 

 

anyway best option seems to be to loop through databaser and convert them into regualr qoutes...

or convert the value to the entity on php output page... a fucntion to start u off:

http://shiflett.org/blog/2005/oct/convert-smart-quotes-with-php

Link to comment
Share on other sites

effigy, encoding? its just dragged off the mp3 metadata to a stirng and then put into the database as a varchar, no special encoding

 

yet some files seem to work without any problems? just checked the id3 when i load the file in xmms and there's no weird characters shown, i cant see why it would do it for only some is the thing

Link to comment
Share on other sites

ID3v1 also lacked support for internationalization. While nominally the text was supposed to be encoded in ISO-8859-1, in practice the user's local encoding was usually used, and so mojibake are common in ID3v1 tags.

-- Wikipedia

 

Unfortunately--based on this information--there are no strict standards for ID3v1. As a result, you need to detect the encoding (unless you can safely assume that ISO-8859-1 was used all of the time), decode the data, and then re-encode the data into UTF-8 before it goes to the database.

Link to comment
Share on other sites

Do you know how these mp3 files were created? Are there a lot of international artists, and therefore "special characters"? You could try a straight ISO-8859-1 to UTF-8 conversion and see if that works...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.