0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【UiPath】UiPathで「Shift-Jis」が使えない場合の対処法

Posted at

UiPathのバージョンによって、「Shift-Jis」のエンコードが使おうとすると「'Shift-Jis' is not a supporterd encoding name.…」とエラーが出てしまう場合がある。
その場合、以下の設定を行った「メソッドを呼び出し」アクティビティを事前に配置しておくと解消でき。

設定方法

アクティビティの配置

アクティビティ一覧から「メソッドを呼び出し(InvokeMethod)」アクティビティを探し、ワークフローに配置する。

image.png

TargetTypeの設定

「メソッドを呼び出し」について、まずはTargetTypeを設定する。
プルダウンをクリックして型の選択画面を開き、「System.Text.Encording」を検索して選択する。

image.png

image.png

検索一発で出てこない場合は、まず「System.Text」で検索し、表示された「System.Private.CoreLib」→「System.Text」を展開していき、出てきた「Encoder」を選択する。

image.png

image.png

パラメーターの設定

次にパラメーターを設定する。
アクティビティのプロパティ欄のパラメーター(コレクション)をクリックし、パラメーター欄を開く。

image.png

パラメーターの型を設定するため、Type欄のプルダウンを選択し、「Browse for Types…」をクリックして型の選択画面を開く。

image.png

今度はEncodingProviderを検索して選択する。

image.png

型の選択後、Value欄に「System.Text.CodePagesEncodingProvider.Instance」を入力する。

image.png

メソッド名の設定

最後に、MethodName欄に「RegisterProvider」と入力すれば完了。
後はこのアクティビティより後ろで「Shift-Jis」が使えるようになる。

image.png

補足

この設定を行った「メソッドを呼び出し」アクティビティを別のプロジェクトのワークフローにコピーすると、パラメーターのValue欄にエラーが表示されることがある。
image.png

この場合はTypeを開いてEncodingProviderを選択し直すことで解消される。
image.png

参考

動作環境

UiPath Studio 2023.10.4

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?