Page 1 of 1

Export trackname to .txt file without diacritic

Posted: 16 Oct 2017 21:16
by djbony
Hello Bernd,
could I send trackname to file without diacritic and only in uppercase?

For example:
trackname: Kryštof - Křídla z mýdla
in .txt: KRYSTOF - KRIDLA Z MYDLA

Uppercase are not important :) Name without diacritic is important for export to RDS or web...

Thanks.

Re: Export trackname to .txt file without diacritic

Posted: 16 Oct 2017 21:25
by radio42
No. Currently the names/titles are exported as is and by default in UTF-8.
I’d assume, that it is the job of the RDS encoder to remove unsupported characters.

Re: Export trackname to .txt file without diacritic

Posted: 16 Oct 2017 21:33
by djbony
Thanks. I solved it by my own program. But, if it could be PF it would be fine :)

Here is code for convert string:

Public Function RemoveDiacritism(ByVal Text As String) As String
Dim stringFormD = Text.Normalize(System.Text.NormalizationForm.FormD)
Dim retVal As New System.Text.StringBuilder()
For index As Integer = 0 To stringFormD.Length - 1
If (System.Globalization.CharUnicodeInfo.GetUnicodeCategory(stringFormD(index)) <> Globalization.UnicodeCategory.NonSpacingMark) Then
retVal.Append(stringFormD(index))
End If
Next
Return retVal.ToString().Normalize(System.Text.NormalizationForm.FormC)
End Function

Re: Export trackname to .txt file without diacritic

Posted: 16 Oct 2017 21:43
by radio42
This is even more elegant:

Code: Select all

string accentedStr = “Kryštof - Křídla z mýdla“;
byte[] tempBytes = System.Text.Encoding.GetEncoding("ISO-8859-8").GetBytes(accentedStr);
string asciiStr = System.Text.Encoding.UTF8.GetString(tempBytes);
So if you have a working solution, why would you use another one?

Re: Export trackname to .txt file without diacritic

Posted: 16 Oct 2017 21:54
by djbony
There is too much application running in the background :) And thanx for your code... Really more elegant!

Re: Export trackname to .txt file without diacritic

Posted: 16 Oct 2017 22:06
by radio42
As said, any RDS encoder should normalize it’s Input. That’s why I see this job not primary one the ProppFrexx side. So please talk to your RDS solution vendor, whythey don‘t normalize the strings.

Furthermore this little conversion doesn’t require a huge background process.

I can put this request on the WishList, but I guess there are many other requests being served first.

Re: Export trackname to .txt file without diacritic

Posted: 17 Oct 2017 06:28
by djbony
Thank you.

Re: Export trackname to .txt file without diacritic

Posted: 25 Oct 2017 22:25
by djbony
Here is my small app for convert text from file to ISO 8859-8... This may help to somebody ;)
For streaming would be fine if the song title was read from a text file...