hi all, is it expected that ByteReadChannel remove...
# ktor
j
hi all, is it expected that ByteReadChannel removes newlines? If so, is there a way to preserve the newlines instead?
e
Hi! Could you tell me how you are reading from channel?
j
we're trying to do something like this
Copy code
OutgoingContent.WriteChannelContent() {
  override val contentType = RdfContentTypes.Turtle
  override suspend fun writeTo(channel: ByteWriteChannel) {
    call.request.receiveChannel().copyTo(channel)
}
where we want to forward the request body to another service
e
It should keep new lines in this case. Could you try use logging or reading body as string?
j
i have, and it does seem to remove newlines
encoding should be default UTF-8, so not sure what's going on
call.request.receiveChannel().readUTF8Line()
should preserve newlines as well right?
e
It will read line by line
j
ok so that is definitely concatenating lines
i'm sending an rdf turtle file, and i see all the prefixes on one line doing that
Copy code
INFO  Application - @prefix rdf: <<http://www.w3.org/1999/02/22-rdf-syntax-ns#>> .@prefix rdfs: <<http://www.w3.org/2000/01/rdf-schema#>> .@prefix owl: <<http://www.w3.org/2002/07/owl#>> .@prefix xsd: <<http://www.w3.org/2001/XMLSchema#>>
where our source file looks like this
Copy code
@prefix rdf: <<http://www.w3.org/1999/02/22-rdf-syntax-ns#>> .
@prefix rdfs: <<http://www.w3.org/2000/01/rdf-schema#>> .
@prefix owl: <<http://www.w3.org/2002/07/owl#>> .
@prefix xsd: <<http://www.w3.org/2001/XMLSchema#>> .
encoding is in utf-8-unix
e
Could you log an issue? I will take a look