github / github/codeql

Query Console has no result when splitting supplementary code points

オープン
#5,297 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
question
主要言語
CodeQL
スター
10.1k
フォーク
2.1k
平均マージ
2日 15時間
マージ済み PR(30日)
141

説明

It appears predicates for the built-in type `string` do not have any result in the Query Console when splitting supplementary Unicode code points into the corresponding surrogate chars.
I am not sure whether the VSCode extension behaves differently, and am not sure either what the expected behavior is.

```ql
select "😊".prefix(1)
```
[Query Console link](https://lgtm.com/query/5938355067463238403/)

Edit: Same also applies when not including the split supplementary code point in the result:
```ql
where exists("😊".prefix(1))
select "hello world"
```

As a side note: Trying to use unpaired surrogates in the Query Console causes "Failed to execute" (cannot provide example code here because GitHub does not preservere unpaired surrogate; and Query Console does not run so cannot provide link either):
![Query Console unpaired surrogate screenshot](https://user-images.githubusercontent.com/11685886/109440476-b7784c80-7a32-11eb-9758-08c54592cd59.png)

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。