Skip to content

px() parses values in PX-files with equal signs (=) incorrectly #356

@trygu

Description

@trygu

https://data.ssb.no/api/pxwebapi/v2-beta/tables/03013/data?lang=no&valueCodes[Konsumgrp]=TOTAL&valueCodes[ContentsCode]=KpiIndMnd&valueCodes[Tid]=2023M04&codelist[Konsumgrp]=vs_CoiCop2016niva1&outputformat=px

This is an API-call to the next version of PxWebApi. It doesn't like Norwegian characters in the VALUES fields it seems. Saving this to example.px, and running the example command in the documentation gives me this result:

> x <- px(input = "example.px")
Error: px object: values cannot contain quotation marks

> Sys.getlocale("LC_CTYPE")
[1] "nb_NO.UTF-8"

Looking at this function which I guess it's called when reading av PX-file:

px_from_px_file <- function(path) {

There doesn't seem to be any explicit setting of encoding hints when reading a PX-file. (this is just based on a very quick look at the source code, so I might be wrong).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions