Open shelomito12 opened 3 years ago
Hi! I think the problem is with the files encoding. Please, check the encoding of the PHP files that are responsible for displaying information about the playing track. Files must be encoded "UTF-8".
Also, your problem can be solved with the following code:
$mp3_stream_title = mb_convert_encoding($mp3_stream_title, 'UTF-8', 'ISO-8859-1');
But I recommend that you check the files encoding. Because when I tested the script on my local server, I had no problems displaying Spanish characters.
If all PHP files are "UTF-8" encoded and Spanish characters are not displayed as expected, write here.
I used Notepad++ to quickly check the encoding of the file:
As you can see it shows the encoding as UTF-8.
Pardon my ignorance: Where/Which line number of the PHP script should I add $mp3_stream_title = mb_convert_encoding($mp3_stream_title, 'UTF-8', 'ISO-8859-1');
?? Should I add this on the main PHP script or the one I run which has the radio URL stream?
Thanks in advance.
Here, using an example from the file "README.md", you can see how you can use the solution to the problem that I suggested above:
<?php
require_once('Mp3StreamTitle/Mp3StreamTitle.php');
use Mp3StreamTitle\Mp3StreamTitle;
$mp3_stream_title = new Mp3StreamTitle();
// Instead of "http://example.com" specify a direct link to the stream of any online radio station.
$stream_title = mb_convert_encoding($mp3_stream_title->sendRequest('http://example.com'), 'UTF-8', 'ISO-8859-1');
echo $stream_title;
I do not like the solution to the problem that I proposed above, so could you please send me a copy of your files, which you use to display information about the playing track, to my email address?
Hey Oleg, I sent you an email with my php files as requested.
PS: I had to remove UTF-8 and just leave ISO-8859-1 and it's working now, but I'll keep monitoring. Thanks!
Using only 'ISO-8859-1' was working fine with some Spanish characters but was still getting some characters not encoding properly so now I'm testing both 'UTF-8' and 'ISO-8859-1'
Sorry for the delay in reply! I checked your PHP files, they are OK. The files have the correct encoding. Unfortunately, I do not know why there are problems with the display of some Spanish characters.
Did you find the perfect solution?
Both the file where the php redirects its output and the console/terminal output on my Ubuntu server display:
"Antonio Piñero - Mateo,..."
The above should display as: "Antonio Piñero - Mateo,..."Screenshot from youtube live stream:![image](https://user-images.githubusercontent.com/10729787/105536612-9f3c4180-5cbe-11eb-9fe6-737c96cd486c.png)
Is it possible to modify the php scripts to support Spanish characters?
Thanks in advance!