google / google/smali

Invalid text error using emojis (UTF-16)

Open
#22 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
400
Forks
67
Avg merge
1d 2h
Merged PRs (30d)
1

Description

Emojis don't match the lexer.

They should match [`SimpleNameCharacter`](https://github.com/google/smali/blob/27a1717337c413364484df0e12e42df7d4fc9d0a/smali/src/main/jflex/smaliLexer.jflex#L260) but they don't for some reason.
For example 🍉 is `\ud83c\udf49` which corresponds to `HighSurrogate` and `LowSurrogate` respectively.

**Example**

Command: `java -jar smali.jar tokens test.smali`

Input

```smali
invoke-virtual {p0}, Lsample/SampleActivity;->🍉()V
```

Output

```
Error for input '🍉': Invalid text
INVALID_TOKEN("\ud83c\udf49")
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.