# `FUN_GET_to_pinyin` (function)


- **Type:** FUNCTION
- **Returns:** `varchar(255)`
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `NAME` | `varchar(255)` |

## Body

_Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE FUNCTION `FUN_GET_to_pinyin`'`._

## Narrative

**Business context:** Converts a Chinese display string to its lowercase pinyin equivalent — a generic name-to-pinyin helper. Returns the original characters untouched if they are ASCII.

**What it does:** hex-encodes the input, then walks two bytes at a time. For each high-byte > 128 (Chinese GBK character) it computes the GBK code point and looks up the pinyin prefix in `t_base_pinyin` (`CODE_ >= ABS(mycode) ORDER BY CODE_ ASC LIMIT 1`); ASCII bytes pass through. Returns the concatenated lowercase string.

**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. The companion `t_base_pinyin` table exists, suggesting this was wired up for a pinyin-search feature that never shipped.
