Title: UNFC Nörmalize
Author: bonger
Published: <strong>2016 年 8 月 2 日</strong>
Last modified: 2017 年 1 月 19 日

---

搜尋外掛

![](https://ps.w.org/unfc-normalize/assets/banner-772x250.png?rev=1465738)

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

![](https://ps.w.org/unfc-normalize/assets/icon-256x256.png?rev=1465738)

# UNFC Nörmalize

 由 [bonger](https://profiles.wordpress.org/gitlost/) 開發

[下載](https://downloads.wordpress.org/plugin/unfc-normalize.1.0.6.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/unfc-normalize/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/unfc-normalize/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/unfc-normalize/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/unfc-normalize/#developers)

 [技術支援](https://wordpress.org/support/plugin/unfc-normalize/)

## 外掛說明

This is a souped-up version of the [Normalizer plugin](https://wordpress.org/plugins/normalizer/)
by [Torsten Landsiedel](https://profiles.wordpress.org/zodiac1978/).

It adds WP filters to normalize UTF-8 data coming into the system to the [de facto web standard Normalization Form C](https://www.w3.org/International/docs/charmod-norm/#choice-of-normalization-form).
The Unicode Consortium report is at [Unicode Normalization Forms](http://www.unicode.org/reports/tr15/).

#### Polyfills

For best performance [install](http://php.net/manual/en/intl.installation.php) (
if possible) the [PHP Internationalization extension `Intl`](http://php.net/manual/en/intro.intl.php),
which includes the PHP class `Normalizer`.

However the plugin works without the PHP `Intl` extension being installed, as it
uses (a modified version of) the [Symfony `Normalizer` polyfill](https://github.com/symfony/polyfill/tree/master/src/Intl/Normalizer).

Also text pasted into (most) inputs is normalized immediately using the JavaScript
[`normalize()` method](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/normalize).
For browsers without normalization support, the [unorm polyfill](https://github.com/walling/unorm)
is used.

#### Background

For further info, see the WP Trac ticket [#30130 Normalize characters with combining marks to precomposed characters](https://core.trac.wordpress.org/ticket/30130)
and this [Make WP Core comment](https://make.wordpress.org/core/2016/05/17/may-17-feature-projects-chat-and-prompt/#comment-30300).

The plugin also works around the Safari-specific issues raised by the WP Trac ticket
[#22363 Accents in attachment filenames should be sanitized](https://core.trac.wordpress.org/ticket/22363).

#### Scanner

For existing data, the plugin includes an administration tool to scan and normalize
the database. **Important:** before using this tool to normalize, please [backup your database](https://codex.wordpress.org/WordPress_Backups).
This is especially important if your database contains non-normalized serialized
data, as this plugin uses the same suck-and-see technique as interconnect/it’s [Database Search and Replace Script in PHP](https://interconnectit.com/products/search-and-replace-for-wordpress-databases/)
to deal with serialized data, and is fallible.

#### And

A google-cheating schoolboy French translation is supplied.

The plugin should run on PHP 5.2.17 to 7.1, and on WP 3.9.13 to 4.7.1.

The project is on [github](https://github.com/gitlost/unfc-normalize).

## 螢幕擷圖

[⌊Before and after: pasting non-normalized text into a post's title and content.⌉⌊
Before and after: pasting non-normalized text into a post's title and content.⌉[

Before and after: pasting non-normalized text into a post’s title and content.

[⌊Before: uploading a file on macOS with Firefox and then viewing with Safari (broken
in Safari).⌉⌊Before: uploading a file on macOS with Firefox and then viewing with
Safari (broken in Safari).⌉[

Before: uploading a file on macOS with Firefox and then viewing with Safari (broken
in Safari).

[⌊After: uploading a file on macOS with Firefox and then viewing with Safari (whee
it works).⌉⌊After: uploading a file on macOS with Firefox and then viewing with 
Safari (whee it works).⌉[

After: uploading a file on macOS with Firefox and then viewing with Safari (whee
it works).

[⌊Front page of the database scan administration tool.⌉⌊Front page of the database
scan administration tool.⌉[

Front page of the database scan administration tool.

## 安裝方式

Install in the standard way via the ‘Plugins’ menu in WordPress and then activate.
No further action is needed.

## 常見問題集

  How can I normalize extra stuff?

You can add normalization to anything that passes its content through a filter. 
The canonical way is to use the `unfc_extra_filters` filter which returns an array
of filter names – for instance, in your theme’s `functions.php` file, add:

    ```
    function mytheme_unfc_extra_filters( $extra_filters ) {
        $extra_filters[] = 'myfilter';
        return $extra_filters;
    }
    add_filter( 'unfc_extra_filters', 'mytheme_unfc_extra_filters' );
    ```

Note that the `unfc_extra_filters` filter is only called in the administration backend.
You can also add a filter directly, to be called in the frontend or backend, by 
referencing the global PHP variable `unfc_normalize`, but you should ensure that
the `Normalizer` polyfill is loaded if you don’t have the PHP `Intl` extension installed:

    ```
    global $unfc_normalize;
    if ( $unfc_normalize ) {
        if ( ! function_exists( 'normalizer_is_normalized' ) ) { // If the "Intl" extension is not installed...
            $unfc_normalize->load_unfc_normalizer_class(); // ...load the polyfill.
        }
        add_filter( 'myfilter', array( $unfc_normalize, 'normalize' ), 6 /* Or whatever priority you choose */ );
    }
    ```

  Does it have a tool to normalize the filenames of files uploaded prior to its 
enabling?

No, it doesn’t. Alas, such files would have to re-uploaded. However if (enough –
or more like any) interest were expressed…

## 使用者評論

![](https://secure.gravatar.com/avatar/d5449dd0f48016322142fdb7248dbd2e38bed29bb27ae6330de580358bc8f728?
s=60&d=retro&r=g)

### 󠀁[Useful for searching multibyte titles using paste from Mac or PDF](https://wordpress.org/support/topic/valid-in-countries-with-multi-byte-pdfs-and-macs/)󠁿

 [yumsun](https://profiles.wordpress.org/yumsun/) 2020 年 3 月 4 日

Thank you very much. I am building a site to upload and search large amounts of 
PDF documents in Japanese. Some of the characters copy and paste from the PDF title,
PDF content, file name, etc. to the WordPress post title did not match the search
due to NFD. *Copy and paste is done on Windows. *Copying and pasting from a Mac 
file name or folder name always results in NFD. It’s working with WordPress 5.3.2.
Thanks to this plugin, the NFD title problem has been solved. We hope that you can
continue the maintenance. I want to donation too. The page I referred to in this
issue. https://core.trac.wordpress.org/ticket/30130 Thanks and Regards, yumsun

![](https://secure.gravatar.com/avatar/1f82d42efd025c09fee843b0e08f68c4b647697fd3eb80f43081b2672642dc42?
s=60&d=retro&r=g)

### 󠀁[made my day](https://wordpress.org/support/topic/made-my-day-16/)󠁿

 [andrekelling](https://profiles.wordpress.org/andrekelling/) 2018 年 12 月 21 日

no update since 3 years. but working with WP 5.0.2. 20 Multisites need to get scanned
and normalised singlewise. But still better then other solutions! Made my day!

 [ 閱讀全部 2 則使用者評論 ](https://wordpress.org/support/plugin/unfc-normalize/reviews/)

## 參與者及開發者

以下人員參與了開源軟體〈UNFC Nörmalize〉的開發相關工作。

參與者

 *   [ bonger ](https://profiles.wordpress.org/gitlost/)
 *   [ Torsten Landsiedel ](https://profiles.wordpress.org/zodiac1978/)

[將〈UNFC Nörmalize〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/unfc-normalize)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/unfc-normalize/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/unfc-normalize/)，或透過 [RSS](https://plugins.trac.wordpress.org/log/unfc-normalize/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/unfc-normalize/)。

## 變更記錄

#### 1.0.6

 * Require explicit define of UNFC_DEBUG. Move load of debug file to ‘init’.
 * Safari submit workaround.
 * WP 4.7.1 compatible.

#### 1.0.5

 * Do load of normalizer in slugs list constructor not items list. Fixes slugs listing
   crash when Intl extension not installed.
 * Ignore case when checking charset (UNFC_Normalize::is_blog_utf8()).
 * WP coding standards (yoda style in unfc_utf8_4range()).
 * Add screenshots.
 * Some extra unittests.
 * WP 4.7.0 compatible.

#### 1.0.4

 * Add _wp_old_slug on normalizing slugs.
 * Escape title in screen reader label in db check.

#### 1.0.3

 * For PHP 5 performance do preliminary preg_match on isNormalized.
 * Improve comments in Normalizer.php, tabs -> 4 spaces, UNFC_REGEX_IS_INVALID_UTF8_XXX
   invert & rename.
 * Fix untested admin notice and adjust tests. Fix some test bleed ($wp_scripts).

#### 1.0.2

 * Move all .php files bar main to includes subdir. Remove unused ajax.
 * Fix single-byte trie. Move regex alts to tools/functions.php.
 * Fix untested admin notice. Adjust tests for untested admin_notice change. Fix
   some test bleed ($wp_scripts).
 * WP 4.6 compatible.

#### 1.0.1

 * First release for wordpress.org repository.
 * Add assets.
 * Include “class-unfc-list_table.php” in .pot file (for forward/backward compat).
 * Remove unused variable in UNFC_DB_Check_Slugs_List_Table.

#### 1.0.0

 * Initial release.

#### 0.9.1

 * Fix bad serialized data corruption on db check.
 * Fix text domain tag.

#### 0.9.0

 * Initial version after renaming from tl-normalize.

## 中繼資料

 *  版本 **1.0.6**
 *  最後更新 **9 年前**
 *  啟用安裝數 **100+**
 *  WordPress 版本需求 ** 3.9.13 或更新版本 **
 *  已測試相容的 WordPress 版本 **4.7.33**
 *  語言
 * [English (US)](https://wordpress.org/plugins/unfc-normalize/)
 * 標籤:
 * [Form C](https://tw.wordpress.org/plugins/tags/form-c/)[Normalization](https://tw.wordpress.org/plugins/tags/normalization/)
   [normalize](https://tw.wordpress.org/plugins/tags/normalize/)[unicode](https://tw.wordpress.org/plugins/tags/unicode/)
   [Unicode Normalization Form C](https://tw.wordpress.org/plugins/tags/unicode-normalization-form-c/)
 *  [進階檢視](https://tw.wordpress.org/plugins/unfc-normalize/advanced/)

## 評分

 5 星，滿分為 5 星

 *  [  2 個 5 星使用者評論     ](https://wordpress.org/support/plugin/unfc-normalize/reviews/?filter=5)
 *  [  0 個 4 星使用者評論     ](https://wordpress.org/support/plugin/unfc-normalize/reviews/?filter=4)
 *  [  0 個 3 星使用者評論     ](https://wordpress.org/support/plugin/unfc-normalize/reviews/?filter=3)
 *  [  0 個 2 星使用者評論     ](https://wordpress.org/support/plugin/unfc-normalize/reviews/?filter=2)
 *  [  0 個 1 星使用者評論     ](https://wordpress.org/support/plugin/unfc-normalize/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/unfc-normalize/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/unfc-normalize/reviews/)

## 參與者

 *   [ bonger ](https://profiles.wordpress.org/gitlost/)
 *   [ Torsten Landsiedel ](https://profiles.wordpress.org/zodiac1978/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/unfc-normalize/)