Skip to content

Encoding problem #69

Open
Open

Description

@LeonardoSanna

Hello, I've a pretty large dataset (> 2 TB) split in six files.

I assumed that UTF-8 were the text encoding of jsonl files. However there are some charachters that apparently are non-UTF.8 and this causes R to fail when I specify the encoding.

Not specifying the encoding results in a messy full_text output

Activity

  1. edsu commented on Dec 10, 2020

    @edsu
    Member

    Do you have an example?

  2. LeonardoSanna commented on Dec 10, 2020

    @LeonardoSanna
    Author

    Update, I found I walkaround:

    1. Import the file in R withouth encoding specification
    2. clean data
    3. export on UTF-8 csv.

    The problem was with the function stream_in producing the error Error in FUN(X[[i]], ...) : invalid multibyte string, element 1 while streaming the json file in a dataframe.

    Not specifying while importing solves the issue, though fileEncoding = "UTF-8" must be specified while writing on the outfile

    However there are still some weird charachters under "full text" I think because of emojis

    These are unicode emojis and I'm ok with that
    RT @ScottAnthonyUSA: <U+26A0><U+FE0F> IT SHOULD BE NOTED that the CDC initially had an embargo placed on CDC testimony. The TRUMP ADMINISTRATION LIFTED…

    But what about this? iOS emoji?

    RT @StocksUnhinged: $SPY $AAL $APT $EXPE $GOOG $DAL $UAL $BA $LAKE $YUM $CMG $HUM $CI #CDC expected to announce first US case of #Wuhan…

  3. edsu commented on Dec 10, 2020

    @edsu
    Member

    If you can give me a tweet id that will help me test.

  4. LeonardoSanna commented on Dec 10, 2020

    @LeonardoSanna
    Author

    If you can give me a tweet id that will help me test.

    1219771346768596992 this the one with the dollar signs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions