A
A
Andrew2017-02-14 09:15:53
Delphi
Andrew, 2017-02-14 09:15:53

Free Pascal ANSI or Unicode?

We are developing an application that is completely based on WinAPI functions. The API documentation recommends using Unicode (if I understand correctly, WinAPI uses Unicode UTF-16). It is also reported that some of the new features only support Unicode.
There was a question, to throw ANSI and to pass a cavity on Unicode (WideString, WideChar)? What "dangers" can await me on the way to the transition from ANSI to Unicode? Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
OnYourLips, 2017-02-14
@OnYourLips

What "dangers" can await me on the way to the transition from ANSI to Unicode? Thank you.
There will be a lot of free time due to the fact that you will avoid many of the problems inherent in single-byte encoding and constant recoding.

M
Mercury13, 2017-02-14
@Mercury13

Swimming, we know. I saw it for a long time on BCB6, and then converted ANSI → UTF-16.
1. Since we have UTF-16, we will have to complicate the work with paths and other things (for example, shortening strings). Previously, the character was one char, now it is one or two WideChar.
2. Where we have low-level lines - we will have to adjust the amount of memory. In all languages, except for C and C++, this is usually not enough: C does not have its own strings, and C++ has autodestructors.
3. Where we have serialization - you have to recode. In ANSI, the addressable unit (byte) is the same as a text character, in Unicode it is no longer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question