r/compsci • • May 17 '19

20+ String Coding Interview Questions for Programmers

https://hackernoon.com/20-string-coding-interview-questions-for-programmers-6b6735b6d31c
113 Upvotes

41 comments sorted by

View all comments

Show parent comments

3

u/czdl May 17 '19 edited May 17 '19

Cocoa / OSX

Windows uses UTF16 which has exactly the same issue.

0

u/quentech May 17 '19

has exactly the same issue

Windows uses fixed 16-bit width characters and string are in fact arrays of them.

1

u/nzodd May 18 '19

What do you mean, the win32 api? So how does it store characters outside the BMP then ?

1

u/masklinn May 18 '19

Same as java or JavaScript, surrogates are visible and you can easily get or create outright invalid text, even ignoring the grapheme cluster issue.