Skip to content

Is the encoding attribute supported on deserialization? #204

Answered by sschuberth
sschuberth asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, this works for me:

val leaguesResources = javaClass.getResource("/HED-Ligen.xml")

val leagues = leaguesResources.openStream().use {
    xml.decodeFromReader<HockeyLigen>(StAXReader(it, encoding = null))
}

Edit: Apparently passing encoding = null causes the encoding to be detected correctly. Would you accept a PR that makes this the default value for that parameter, @pdvrieze?

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@sschuberth
Comment options

@sschuberth
Comment options

@sschuberth
Comment options

@sschuberth
Comment options

Answer selected by sschuberth
@pdvrieze
Comment options

@pdvrieze
Comment options

@sschuberth
Comment options

@pdvrieze
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants