# WindowsでシフトJISに登録のない文字(例：㎥, –)でデータをフィルタする方法

**URL:** <https://community-ja.exploratory.io/t/topic/381>\
**Category:** How To\
**Created:** [2020 年 10 月 29 日午前 6:35 UTC](https://community-ja.exploratory.io/t/topic/381 "2020-10-29T06:35:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hide\_Kojima](https://community-ja.exploratory.io/user_avatar/community-ja.exploratory.io/hide_kojima/32/12_2.png) [@Hide\_Kojima](https://community-ja.exploratory.io/u/Hide_Kojima)\
**Post date:** [2020 年 10 月 29 日午前 6:35 UTC](https://community-ja.exploratory.io/t/topic/381/1 "2020-10-29T06:35:43Z")

</div>

Windows環境で、データの中に㎥や–のようにシフトJISに登録のない文字があり、その文字を使ってフィルタしようとすると、以下のように該当行がないと判定されることがあります。

 ![image](https://community-ja.exploratory.io/uploads/default/original/1X/6bd5a7d1462004d98ef8808e533a1744a006ed0b.png)

その場合、回避策として明示的にUnicodeのコードを指定すると操作することができます。

```r
X1 == "\u33a5"

```

 ![image](https://community-ja.exploratory.io/uploads/default/original/1X/7aeacbab4f888e0f36b8b804c1a018b6fd132761.png)

参考：[Unicode Character 'SQUARE M CUBED' (U+33A5)](https://www.fileformat.info/info/unicode/char/33a5/index.htm)

ちなみに、横棒の一種である"–"の文字はUnicodeでは\u2013となり、以下のようにすればテキストデータの加工等で識別できます。

 ![image](https://community-ja.exploratory.io/uploads/default/original/1X/ec39deb4b9850153459a28575d7fc94c6b4981db.png)

---

<div class="post-metadata">

**Author:** ![Yasuhiro\_Yatsuu](https://community-ja.exploratory.io/user_avatar/community-ja.exploratory.io/yasuhiro_yatsuu/32/14_2.png) [@Yasuhiro\_Yatsuu](https://community-ja.exploratory.io/u/Yasuhiro_Yatsuu)\
**Post date:** [2020 年 10 月 30 日午前 1:20 UTC](https://community-ja.exploratory.io/t/topic/381/2 "2020-10-30T01:20:29Z")

</div>

なるほど！  
これは「カスタム」でやるところがミソなんですね！  
普通に「列」で入れると（「\」がエスケープされてしまって）  
うまくいかないなぁと少し悩みました。

また、例えばMutateなどでも同じように使えたので、  
システム内では「㎥」と「\u33a5」は等価なのだと理解しました。

文字コードで躓いたときは、例えばhttps://tech-unlimited.com/escape-unicode.html  
などを使って直接文字コードで指定してみるという方法を試してみます。
