0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

SQLServerでUnicodeの外字領域文字を確認するテーブルを作成する

Posted at

Unicodeの外字領域(E000~F8FF)に文字が入っているか確認するサンプルコードです。

サンプル

eudc.sql
CREATE TABLE eudc(
  private_use_area nvarchar(4) NOT NULL,
  char_eudc        nvarchar(1) NOT NULL);

DECLARE @EUDC_START INT = 57344; -- E000
DECLARE @EUDC_END   INT = 63743; -- F8FF
DECLARE @EUDC_Char  INT = @EUDC_START;

WHILE (@EUDC_Char <= @EUDC_END)
BEGIN
  
  INSERT INTO eudc(private_use_area,char_eudc)
  VALUES(CONVERT(VARCHAR(4), CAST((@EUDC_Char) AS VARBINARY(2)), 2 ),NCHAR(@EUDC_Char));
 
  SET @EUDC_Char += 1;

END

参考

Unicode(私用領域)

0
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?