Author Topic: "Special" characters not working on shoutcast  (Read 7802 times)

Dennis

  • Posts: 16
Hi Everyone,

I'm sending artist and title data to my test shoutcast server (windows) and when there's a "special" character used, it shows up funny on the playlist.

For example when the artist is: René & Angela 
It shows: Ren˙FFFFE9 & Angela on the shoutcast server

Could this be a bass problem, a shoutcast problem or did i make a mistake during coding? :) I looked for this problem on the shoutcast forums, but i isn't mentioned there, so i thought to check it here :)

Kind regards,
Dennis

Ian @ un4seen

  • Administrator
  • Posts: 20433
Re: "Special" characters not working on shoutcast
« Reply #1 on: 10 Aug '09 - 16:41 »
Shoutcast metadata is in ANSI form, so you need to make sure that you're both setting and receiving it correctly (eg. not using UTF-8). To determine which end the problem is at, does the "René & Angela" text look OK in the stream status webpage, ie. if you open the stream URL in a browser?

Dennis

  • Posts: 16
Re: "Special" characters not working on shoutcast
« Reply #2 on: 11 Aug '09 - 14:29 »
Hi Ian.

Nope, it's the same over there. I've googled for a function to covert the current string value to another format (e.g. Latin1 or Ansi), but can't seem to find it....

Do you (or anyone else) know of a function in vb.net to check what format the string is in? And even better how to convert it to the right format?

Kind Regards,
Dennis

radio42

  • Posts: 4576
Re: "Special" characters not working on shoutcast
« Reply #3 on: 11 Aug '09 - 15:34 »
You might try the .Net "Uri.EscapeDataString" method.

Ian @ un4seen

  • Administrator
  • Posts: 20433
Re: "Special" characters not working on shoutcast
« Reply #4 on: 12 Aug '09 - 15:57 »
Nope, it's the same over there. I've googled for a function to covert the current string value to another format (e.g. Latin1 or Ansi), but can't seem to find it....

Just to confirm whether it is a BASSenc or .Net issue, you could try to reproduce the problem with the precompiled CAST.EXE example (in the C\BIN directory).

Dennis

  • Posts: 16
Re: "Special" characters not working on shoutcast
« Reply #5 on: 14 Aug '09 - 13:28 »
Tried the "Uri.EscapeDataString", but it showed Ren%C3%A9%20%26%20Angela. The cast example in the BIN folder has the same problem.
Just installed the DSP pluging for winamp and that one works just fine, so i guess it's a base (.net) problem.

Using Uri.EscapeDataString: Ren%C3%A9%20%26%20Angela
Using normal string: Ren˙FFFFE9 & Angela
Using Winamp Shoutcast DSP: René & Angela

Hopefully this helps a little :)

Kind regards,
Dennis

radio42

  • Posts: 4576
Re: "Special" characters not working on shoutcast
« Reply #6 on: 14 Aug '09 - 14:43 »
I guess the regular Winamp DSP uses Latin-1 resp. Codepage-1250 as it's character set to update the song-tiltles.
As .Net always stores Unicode characters the problem is not natively a BASS.NET issue.
So you might try to convert the string to the resp. character set using the .Net Encoding classes.

Ian @ un4seen

  • Administrator
  • Posts: 20433
Re: "Special" characters not working on shoutcast
« Reply #7 on: 14 Aug '09 - 15:55 »
Tried the "Uri.EscapeDataString", but it showed Ren%C3%A9%20%26%20Angela. The cast example in the BIN folder has the same problem.

Just to be sure, is that the CAST example in BASSenc's C\BIN directory? If so, that would suggest it is a BASSenc issue rather than a .Net one, as that example doesn't use .Net. When I tried setting the track title to "René & Angela" myself, it was shown correctly (eg. in the stream's status webpage), so if you're finding that it isn't, then perhaps it is down to the Windows version/language. What version/language are you using?

Dennis

  • Posts: 16
Re: "Special" characters not working on shoutcast
« Reply #8 on: 14 Aug '09 - 17:46 »
Jep, it was the executable found in C\BIN :) Windows versions i used are:

XP Professional SP3 - NL
XP Professional SP3 - UK
Windows 2003 server R2 SP2 - UK

Both give the "error"... Weird problem ???

Kind Regards,
Dennis

Dennis

  • Posts: 16
Re: "Special" characters not working on shoutcast
« Reply #9 on: 14 Aug '09 - 23:26 »
I guess the regular Winamp DSP uses Latin-1 resp. Codepage-1250 as it's character set to update the song-tiltles.
As .Net always stores Unicode characters the problem is not natively a BASS.NET issue.
So you might try to convert the string to the resp. character set using the .Net Encoding classes.

I'm working on this for hours and i've come up with the following code:

            Dim oEncoderAnsi As System.Text.Encoding
            Dim oEncoderSource As System.Text.Encoding

            Dim bufwrite
            Dim bufwritetemp
            Dim towrite = Artist

            oEncoderSource = System.Text.Encoding.Unicode
            oEncoderAnsi = System.Text.Encoding.GetEncoding(1250)

            bufwritetemp = oEncoderSource.GetBytes(towrite)
            bufwrite = System.Text.Encoding.Convert(oEncoderSource, oEncoderAnsi, bufwritetemp)
            Player1Artist = oEncoderAnsi.GetString(bufwrite)

It is based on some code i found on google for enconding to chinese (950). When i use 950, the output is Rene & Angela (not René & Angela). When i change it to 1250 (as in the current code above), i get the same Ren˙FFFFE9 & Angela as always.....

Hopefully someone has an answer, because i'm clueless after spending 10 hours testing en programming :)

Kind Regards,
Dennis

Ian @ un4seen

  • Administrator
  • Posts: 20433
Re: "Special" characters not working on shoutcast
« Reply #10 on: 17 Aug '09 - 14:56 »
Jep, it was the executable found in C\BIN :) Windows versions i used are:

XP Professional SP3 - NL
XP Professional SP3 - UK
Windows 2003 server R2 SP2 - UK

Both give the "error"... Weird problem ???

That is very strange then. What "Language for non-Unicode programs" setting do you have in the "Regional and Language Options" control panel?

Please also confirm where you are checking the title? If you haven't already done so, you could check if it's the same in the stream's status webpage (ie. open the stream URL in a browser), Winamp, and the pre-compiled NETRADIO.EXE example (in C\BIN). Please also confirm what BASSenc DLL version you are using.

Dennis

  • Posts: 16
Re: "Special" characters not working on shoutcast
« Reply #11 on: 17 Aug '09 - 21:34 »
I'm testing on three computers, so here are the settings for Language for non-Unicode programs:

Windows XP SP3 NL -> Dutch (Netherlands)
Windows XP SP3 UK -> English (United States)
Windows 2003 Server R2 SP2 -> English (United States)

I checked the title in:

- Winamp: same problem
- Shoutcast stream status page: same problem
- pre-compiled NETRADIO.exe: same problem.

I checked the bassenc.dll and it was 2.4.3.0, so checked the downloadpage and found a new version.
I checked it again with bassenc.dll version 2.4.4.1: same problem :(

Ian @ un4seen

  • Administrator
  • Posts: 20433
Re: "Special" characters not working on shoutcast
« Reply #12 on: 18 Aug '09 - 17:51 »
OK. I'll send you a debug version to find out what's going on there.

Dennis

  • Posts: 16
Re: "Special" characters not working on shoutcast
« Reply #13 on: 18 Aug '09 - 19:47 »
Ok... I'll be waiting :)

Ian @ un4seen

  • Administrator
  • Posts: 20433
Re: "Special" characters not working on shoutcast
« Reply #14 on: 19 Aug '09 - 15:47 »
It was sent shortly after my post, so should have arrived before your post :)

If you still don't have it, please check your "spam" folder, and if you can't find it there either, drop me an email to confirm your email address.

Dennis

  • Posts: 16
Re: "Special" characters not working on shoutcast
« Reply #15 on: 19 Aug '09 - 19:30 »
send you a mail :)

Dennis

  • Posts: 16
Re: "Special" characters not working on shoutcast
« Reply #16 on: 20 Aug '09 - 20:38 »
tested the app with the debug version of Ian and it worked fine! So i downloaded the bassenc zip file and unzipped it again and it works fine again. I have no clue what happend, but it just works fine... Maybe the dll got damaged somehow during copying or something....

Anyhow... I'm glad it now works! Thanks everyone for you help and support!

Kind regards,
Dennis