Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
RRay
Frequent Visitor

Unsupported conversion from '' to 'ASCII' in codepage 1252, works in desktop

Hi,

 

I want to perform a GET request in R visual and am using HTTR library to do this. While this works in Power BI desktop, the R visual does not display in Power BI service.

I get an error: 

[1] "unknown" Error in iconv(x, "latin1", "ASCII") : unsupported conversion from 'latin1' to 'ASCII' in codepage 1252  
Please try again later or contact support. If you contact support, please provide these details.

Activity ID60de9fff-bb65-4783-832c-9bf532236ac1
Request IDa2bc845b-c993-04e5-c427-d527105d8fc4
Correlation ID8f5e7963-f6cb-a0b8-1659-cd4b6af5a4a2
TimeThu Nov 29 2018 16:20:21 GMT-0800 (Pacific Standard Time)
Version13.0.7382.168
 

Here is the code snippet:

 

library(httr)
x <- dataset[1,1]

call <- "http://168.61.16.151/score?&p1_delay=0.1&p2_delay=2&p3_delay=50&p4_delay=0.15&Authorization=Bearer,NWIFwYUcRF1toCtEkdA9NMhgDuNZVTwx"

calla <-iconv(call, to = "UTF-8")
gta <- GET(calla)

plot(1,1)
title(sub=x)

 

 

Strangely, calla <-iconv(call, to = "UTF-8") does not throw any runtime errors.

 

On trying to pinpoint the issue, I have removed all library usage, and see that I still get a runtime error:

[1] "unknown" Error in iconv(call, to = "ASCII") : unsupported conversion from '' to 'ASCII' in codepage 1252  
Please try again later or contact support. If you contact support, please provide these details.

Activity ID60de9fff-bb65-4783-832c-9bf532236ac1
Request IDccaac9cf-0213-d7c5-dcd6-5997b9bd5b6d
Correlation ID74cf3026-f5d5-df26-be16-81e39362bf70
TimeThu Nov 29 2018 16:17:14 GMT-0800 (Pacific Standard Time)
Version13.0.7382.168
 

I am using this sample code:

x <- dataset[1,1]

call <- "http://168.61.16.151/score?&p1_delay=0.1&p2_delay=2&p3_delay=50&p4_delay=0.15&Authorization=Bearer,NWIFwYUcRF1toCtEkdA9NMhgDuNZVTwx"

calla <-iconv(call, to = "ASCII")

plot(1,1)
title(sub=x)

Any help is very much appreciated!

Thanks!

 

8 REPLIES 8
v-jiascu-msft
Employee
Employee

Hi @RRay,

 

I have reported this issue to the Product Team: CRI 94253393. I will update the process here.

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-jiascu-msft,

Is there an ETA or priority on this please?

 

Thanks,

Ratna Ray

Hi Ratna,

 

I have gotten the result that says "outgoing calls from R visuals in the service isn't supported". The calls from R visuals could be expensive in my opinion.  

Can you retrieve the data into Power BI first as a query? It could work around this limitation.

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Dale,

 

I am not sure I follow; can you please explain?

 

Let me try to explain the context for this: We pick the slicer values selected by the user, and pass these as into an R visual as datasets. Within the visual, these are used as parameters into a ML Web API endpoint. Which it why it has to be a GET call from the R visual. We parse the json response to a text. To do this, we only need the httr and stringr libraries, both supported by Power BI Service: https://docs.microsoft.com/en-us/power-bi/service-r-packages-support#r-packages-that-are-supported-i...

 

We figured out that this isn't a problem with the libraries, because a normal conversion also throws the same error message in Power BI Service. Can you suggest any other alternatives?

 

Thanks,

Ratna

Hi Ratna,

 

Actually, there are two parts of R on Power BI. One is the R visual while the other is R script as a data source. The responses from the Product Team say the call from R visual isn't supported, which means the R visual only can use the local dataset. 

The workaround could be loading all the data and then interact with R visual. The Httr is supported when it's used in the data source. I tested it. Please give it a try and give some feedback if you can. 

Unsupported-conversion-from

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you Dale,

We do see that the call works in a Power BI data source.

 

Strangely, the documentation mentions that this is supported in R visuals in the Power BI service: https://docs.microsoft.com/en-us/power-bi/visuals/service-r-visuals."R visuals in the Power BI service are supported by the packages found in the Supported Packages section found in this article"

 

While this does say that Power BI Service supports R visuals using only packages in CRAN; so I was wondering if RODBC is also unsupported? To be able to load all the data, we want to use Azure SQL DB, and we are getting an error "first argument is not an open RODBC channel"

Are we doing something wrong? Here is the code snippet:

 

library(RODBC)
connectionString <- paste0("Driver=", Driver, ";Server=", Server, ";Database=", Database, ";Uid=", User, ";Pwd=", Password)
sqlQuery <- "SELECT 1  FROM dbo.ARM"

conn <- odbcDriverConnect(connectionString)
df <- sqlQuery(conn, sqlQuery)
close(conn)

Thanks,

Ratna Ray

@RRay ,

 

We do not support outgoing calls from R visuals in the service.

This should be documented (and support for httr removed unless it is used for something else).

 

Regards,

Jimmy Tao

Takk skal du ha!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors