Export trackname to .txt file without diacritic
Export trackname to .txt file without diacritic
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.
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
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.
I’d assume, that it is the job of the RDS encoder to remove unsupported characters.
Bernd - radio42
ProppFrexx ONAIR - The Playout and Broadcast Automation Solution
ProppFrexx ONAIR - The Playout and Broadcast Automation Solution
Re: Export trackname to .txt file without diacritic
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
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
This is even more elegant:
So if you have a working solution, why would you use another one?
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);
Bernd - radio42
ProppFrexx ONAIR - The Playout and Broadcast Automation Solution
ProppFrexx ONAIR - The Playout and Broadcast Automation Solution
Re: Export trackname to .txt file without diacritic
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
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.
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.
Bernd - radio42
ProppFrexx ONAIR - The Playout and Broadcast Automation Solution
ProppFrexx ONAIR - The Playout and Broadcast Automation Solution
Re: Export trackname to .txt file without diacritic
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...
For streaming would be fine if the song title was read from a text file...
- Attachments
-
- RDS Convert.rar
- (58.65 KiB) Downloaded 307 times