Skip to content

Commit

Permalink
fix: local code decoder charset.
Browse files Browse the repository at this point in the history
  • Loading branch information
oxyroid committed Jan 22, 2024
1 parent 7bbb6e4 commit 0d7dd49
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions data/src/main/java/com/m3u/data/net/udp/Broadcast.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import kotlinx.coroutines.flow.flowOn
import java.net.DatagramPacket
import java.net.DatagramSocket
import java.net.InetAddress
import java.nio.charset.Charset

interface Broadcast {
fun send(bytes: ByteArray)
Expand All @@ -28,7 +27,7 @@ data class LocalCode(

fun decode(bytes: ByteArray): LocalCode {
val line = bytes
.toString(Charset.defaultCharset())
.toString(Charsets.UTF_8)
.run {
take(indexOf('#', 1))
}
Expand Down

0 comments on commit 0d7dd49

Please sign in to comment.