# Alpha-- support for UTF-16: emoji on Windows

**URL:** <https://swi-prolog.discourse.group/t/alpha-support-for-utf-16-emoji-on-windows/5566>\
**Category:** Announce\
**Created:** [June 29, 2022, 1:43pm UTC](https://swi-prolog.discourse.group/t/alpha-support-for-utf-16-emoji-on-windows/5566 "2022-06-29T13:43:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [June 29, 2022, 1:43pm UTC](https://swi-prolog.discourse.group/t/alpha-support-for-utf-16-emoji-on-windows/5566/1 "2022-06-29T13:43:31Z")

</div>

I have uploaded a lot of patches that establishes support for

- Reading and writing UTF-16. The encoding names have changed from `unicode_le` and `unicode_be` to `utf16le` and `utf16be`, accepting the old as aliases. This affects all platforms.
- Handle `wchar_t` arrays in the Windows version as UTF-16 rather than UCS-2.

As a result, Windows should be able to represent the full Unicode range, except the code units associated with UTF-16 _surrogate pairs_.

**Status**

- These changes are quite large and may have caused some regression, also on non-Windows platforms.
- Most seems to work on Windows. Some known glitches
  - The console (`swipl-win.exe`) doesn’t know about UTF-16, causing some problems with copy/paste and deleting/inserting the individual characters of a surrogate pair. It also doesn’t handle color fonts. These seems unsupported in the old Windows GDI functions. Anyone with Windows C API experience willing to pick this up?

- XPCE has not been updated and thus will often go wrong on surrogate pairs.
- Documentation is not updated.

**Availability**

Should be in tomorrows (June 26, 2022) daily build.

 ![image](https://global.discourse-cdn.com/free1/uploads/swiprolog/original/2X/3/31802dca7f8665a2c5e8c7f0e98e5266fe616e61.png)
