Repository: stable-diffusion-webui
Issue: [Bug]: Search function not reading certain Unicode characters (accents)
Labels: bug-report

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

The search function will only recognize accents when they are typed in a certain way.

I run MacOS Ventura, so I am unsure how this interacts with Windows.

There are two ways to type a letter with an accent in Unicode: either by typing Alt+an appropriate letter (e, n, u, `, etc.), or by first typing the letter, _then_ typing Alt+Shift+an appropriate letter.

Converted to Unicode, the difference is as follows:
Alt+E then E: \u00E9
E, then Alt+Shift+E: e\u0301

However, the search function does not seem to recognize \u00E9 as a valid character.

<img width="1552" alt="ALT+E doesn't work" src="https://github.com/AUTOMATIC1111/stable-diffusion-webui/assets/48635148/98575a6f-ef03-4983-a5dd-a72014c09bf8">

And yet, it _does_ recognize e\u0301 as a valid character.

<img width="1552" alt="But E+AltShiftE works; you can only do this in ABC Extended" src="https://github.com/AUTOMATIC1111/stable-diffusion-webui/assets/48635148/d98096dd-f099-4f9a-9753-3120c55c16a7">

Same thing happens using other characters.

<img width="1552" alt="testing with a" src="https://github.com/AUTOMATIC1111/stable-diffusion-webui/assets/48635148/4e96ce2c-9463-420a-86dd-ea885f9b76c5">

However, on Mac, I can only use the "E then Alt+Shift+E" method on the ABC-Extended Keyboard; on the default English keyboard (US, GB, etc.), this functionality is unavailable, and so the primary way to type accents is the former method.

I have tried renaming the files in question, but (at least on my Mac), Unicode character u\00E9 transforms into e\u0301 when it is included in the name of a file.

### Steps to reproduce the problem

1. Name a file in LoRAs by using a character from the Roman alphabet with an accent, e.g. é, à, ñ, etc.
2. Load Automatic1111.
3. Type the single character-variant of the accented character into the search bar (most likely located within the "Latin-1 Supplement", "Latin Extended-A" or "Latin Extended-B" Unicode Blocks). The search bar should show nothing.
4. Type the double character-variant of the accented character into the search bar (most likely falls within the "Combining Diacritical Marks" Unicode Block, 0300-036F). The search bar should properly display the LoRA.


### What should have happened?

The search function should read accented characters with a single Unicode value (The Alt+Letter then Letter method) and accented characters with a double Unicode value (The Letter then Alt+Shift+Letter method) the same way.

### Sysinfo

[sysinfo-2023-10-23-18-07.txt](https://github.com/AUTOMATIC1111/stable-diffusion-webui/files/13074857/sysinfo-2023-10-23-18-07.txt)


### What browsers do you use to access the UI ?

Google Chrome

### Console logs

```Shell
Last login: Mon Oct 23 10:35:44 on ttys000
gavin@dhcp-v068-065 ~ % cd stable-diffusion-webui && ./webui.sh --deepdanbooru --api --gradio-img2img-tool color-sketch

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################

################################################################
Running on gavin user
################################################################

################################################################
Repo already cloned, using it as install directory
################################################################

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
Python 3.10.13 (main, Sep  4 2023, 20:22:24) [Clang 14.0.3 (clang-1403.0.22.14.1)]
Version: v1.6.0-RC-70-g2a4d29e3
Commit hash: 2a4d29e325ef00fac66cee180bac3c2fd1a60101
Launching Web UI with arguments: --deepdanbooru --api --gradio-img2img-tool color-sketch --skip-torch-cuda-test --skip-install --no-download-sd-model --no-half-vae --upcast-sampling --use-cpu interrogate
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
Warning: caught exception 'Torch not compiled with CUDA enabled', memory monitor disabled
Civitai Helper: Get Custom Model Folder
No pyAesCrypt - won't be able to do encryption
No pyAesCrypt - won't be able to do encryption
Tag Autocomplete: Could not locate model-keyword extension, Lora trigger word completion will be limited to those added through the extra networks menu.
*** Error loading script: !adetailer.py
    Traceback (most recent call last):
      File "/Users/gavin/stable-diffusion-webui/modules/scripts.py", line 382, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
      File "/Users/gavin/stable-diffusion-webui/modules/script_loading.py", line 10, in load_module
        module_spec.loader.exec_module(module)
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "/Users/gavin/stable-diffusion-webui/extensions/adetailer/scripts/!adetailer.py", line 17, in <module>
        from rich import print
    ModuleNotFoundError: No module named 'rich'

---
2023-10-23 10:36:39,254 - ControlNet - INFO - ControlNet v1.1.401
ControlNet preprocessor location: /Users/gavin/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/downloads
2023-10-23 10:36:39,313 - ControlNet - INFO - ControlNet v1.1.401
sd-webui-prompt-all-in-one background API service started successfully.
Civitai: API loaded
[text2prompt] Following databases are available:
    all-MiniLM-L6-v2 : danbooru_strict
    all-mpnet-base-v2 : danbooru_strict
Loading weights [a1535d0a42] from /Users/gavin/stable-diffusion-webui/models/Stable-diffusion/Anime/AnythingV5Ink_ink.safetensors
Creating model from config: /Users/gavin/stable-diffusion-webui/configs/v1-inference.yaml
/Users/gavin/stable-diffusion-webui/extensions/stable-diffusion-webui-aesthetic-gradients/scripts/aesthetic.py:52: GradioDeprecationWarning: The `style` method is deprecated. Please set these arguments in the constructor instead.
  with gr.Row().style(equal_height=False):
[text2prompt] Loading database with name "all-mpnet-base-v2 : danbooru_strict"...
[text2prompt] Database loaded
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Civitai: Check resources for missing info files
Civitai: Check resources for missing preview imagesStartup time: 10.8s (prepare environment: 0.1s, import torch: 1.4s, import gradio: 0.4s, setup paths: 0.4s, other imports: 0.5s, list SD models: 0.6s, load scripts: 1.2s, create ui: 0.9s, gradio launch: 2.1s, app_started_callback: 2.9s).

Civitai: Found 0 resources missing info files
Civitai: No info found on Civitai
Civitai: Found 17 resources missing preview images
Civitai: No preview images found on Civitai
Applying attention optimization: sub-quadratic... done.
Model loaded in 8.2s (load weights from disk: 0.2s, create model: 0.5s, apply weights to model: 5.8s, apply dtype to VAE: 0.1s, move model to device: 0.7s, load textual inversion embeddings: 0.5s, calculate empty prompt: 0.3s).
```


### Additional information

To reiterate, I am using a Mac — specifically, MacOS Ventura 13.5.2. And part of my issue is that the way that Mac interprets file names does not match up with how I type those file names. I assume that part of this is to assist in searching files, so that if I search "e," files containing e, é, è, ẽ, ë and everything else will show up. However, it does make searching for LoRAs a little bit more inconvenient.