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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
sashan
Regular Visitor

r script code page to Unicode

I am pulling twitter data for my Machine Learning experiment
After I get the data from my search, I want to turn it to a dataframe like this:

 

tweets <- searchTwitter("Bicester Village", n=1000)

df <- do.call("rbind", lapply(tweets, as.data.frame))

 

Twitter data arrives as list of S4 elements. I can successfully carry out experiment in my R Studio and get the results I want.

I then want to see if the data will display in sources, but I see this error:

Error

Details: "Unable to translate bytes [ED][A0] at index 1 from specified code page to Unicode."

I have tried endlesly to convert to UTF-8 (which is not a problem in R Studio), but no luck

2 REPLIES 2
Anonymous
Not applicable

Hi @sashan,

 

Can you share some detail content about this issue?

 

Since you mentioned about use r script with twitter api, you can also take a look at below article :

Twitter Analysis using SSIS 2016 and SQL Server R Services

 

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

Hi @sashan

 

I too got the same issue.

I have solved this as below

 

library(twitteR)
library(stringi)
tweets <- searchTwitter("Bicester Village", n=100,lang="en")
df <- twListToDF(tweets)
df$text <- stri_encode(df_tweets$text, "", "UTF-8")

 

But strange thing is it works fine in RStudio but not in power bi query sometimes

 

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.