> ## Documentation Index
> Fetch the complete documentation index at: https://docs-docflow.textin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 中国語カテゴリパラメータの受け渡し問題

> 中国語またはその他の非英語カテゴリ名を API パラメータとして渡す際の問題を解決します

DocFlow API を使用する際、ファイルカテゴリ名に中国語またはその他の非英語文字が含まれている場合、カテゴリ名をそのまま渡すと次の問題が発生する可能性があります。

1. **カテゴリのマッチング失敗**: API が中国語カテゴリ名を正しく認識できない
2. **処理エラー**: カテゴリが存在しないというエラーメッセージが返される
3. **エンコード問題**: 非 ASCII 文字を含む URL パラメータによりリクエストが失敗する

## 解決方法

### 1. URL エンコード処理

中国語カテゴリ名は、API パラメータとして渡す前に UTF-8 URL エンコードする必要があります。

#### Python の例

```python theme={null}
import urllib.parse

# 元の中国語カテゴリ名
category = "发票"

# URL エンコード
encoded_category = urllib.parse.quote(category)
print(f"エンコード後: {encoded_category}")
# 出力: %E5%8F%91%E7%A5%A8
```

#### JavaScript の例

```javascript theme={null}
// 元の中国語カテゴリ名
const category = "发票";

// URL エンコード
const encodedCategory = encodeURIComponent(category);
console.log(`エンコード後: ${encodedCategory}`);
// 出力: %E5%8F%91%E7%A5%A8
```
