# Difference between Utf8String and WideString

**URL:** https://talk.remobjects.com/t/difference-between-utf8string-and-widestring/32356
**Category:** Remoting SDK
**Created:** [October 28, 2025, 7:05pm UTC](https://talk.remobjects.com/t/difference-between-utf8string-and-widestring/32356 "2025-10-28T19:05:57Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![rgomezc](https://talk.remobjects.com/user_avatar/talk.remobjects.com/rgomezc/32/530_2.png) [@rgomezc](https://talk.remobjects.com/u/rgomezc)
#### Post date: [October 28, 2025, 7:05pm UTC](https://talk.remobjects.com/t/difference-between-utf8string-and-widestring/32356/1 "2025-10-28T19:05:57Z")

</div>

Hello,

As the title says: what’s the difference for those 2 string types?

I have a RODL where I am seeing most of the strings are using the `WideString` type, and in another app I mostly have `Utf8String`. I don’t know exactly what are the implications of this, specially as for what I can see, both types end using the `UnicodeString` type in the C++Builder files.

My server apps are made with C++Builder. Clients are a mix of C++Builder and .NET apps.

---

<div class="post-metadata">

### Author: ![rgomezc](https://talk.remobjects.com/user_avatar/talk.remobjects.com/rgomezc/32/530_2.png) [@rgomezc](https://talk.remobjects.com/u/rgomezc)
#### Post date: [October 28, 2025, 7:16pm UTC](https://talk.remobjects.com/t/difference-between-utf8string-and-widestring/32356/2 "2025-10-28T19:16:16Z")

</div>

Ok, so a little trip to the documentation (I always forget it exists) confirms more or less what I thought: the `Utf8String` will use less space in the wire, even if it ends in the same `UnicodeString` type on the Client/Server… and that is recommended when one of the sides is a .NET app… other than that, it should be transparent?

When dealing with REST clients, is there any difference or recommendation regarding string types?

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [October 28, 2025, 9:01pm UTC](https://talk.remobjects.com/t/difference-between-utf8string-and-widestring/32356/3 "2025-10-28T21:01:01Z")

</div>

> [@rgomezc](#):
>
> Ok, so a little trip to the documentation (I always forget it exists) confirms more or less what I thought: the `Utf8String` will use less space in the wire, even if it ends in the same `UnicodeString` type on the Client/Server… and that is recommended when one of the sides is a .NET app… other than that, it should be transparent?

Correct. I recommend to always us Utf8String; the only good reasons to still use WideString would be _either_ if you need to support clients or servers on a very old legacy version of Remoting SDK that doesn’t support Utf8String in the message format yet _ **or** _ if you expect the vast amount of texts you transfer not to be be represented as single 8-bit Utf8 characters.

The latter could be the case if you’re sending, say, a majority of Chinese text, or emojis.

In UTF-16 (widestring) most Unicode code points ("letters) fit within one 16-bit character – including accented chars, Chinese, Japanese, etc. Some (eg Emoji) will still be need two characters.

In UTF-8, most _Latin_ characters (eg, English text) will fit within single 8-bit characters., Accents & co (which are usually few and far between, even in e.g French) will be 2\*8n = 16-bit surrogate pairs, but Chinese, Japanese, Emoji, or other fancy Unicode characters can require 4 or even more 8-bit characters to represent.

TL;DR: UTF-8 is way more efficient (almost 50% the size) for latin-letter text, but maybe/will be less efficient for text more heavy on non-latin characters.

---

<div class="post-metadata">

### Author: ![rgomezc](https://talk.remobjects.com/user_avatar/talk.remobjects.com/rgomezc/32/530_2.png) [@rgomezc](https://talk.remobjects.com/u/rgomezc)
#### Post date: [October 28, 2025, 10:02pm UTC](https://talk.remobjects.com/t/difference-between-utf8string-and-widestring/32356/4 "2025-10-28T22:02:21Z")

</div>

Thanks for your detailed explanation Marc!

In my case is only latin characters (spanish). So with that in mind I’ll change the WideString entries to Utf8String.
