Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3833

ReplaceAll acts as ReplaceAllBytes when search string's encoding is Nil

$
0
0

Does anyone else think this is a bug?

https://tracker.xojo.com/xojoinc/xojo/-/issues/77262

In the following code:

dim NBSPAsBytes As String

NBSPAsBytes=ChrB(&hE2) + ChrB(&H80) + ChrB(&HAF)

dim UTF8NBSP as string

UTF8NBSP=DefineEncoding(ChrB(&hE2) + ChrB(&H80) + ChrB(&HAF), encodings.UTF8)

UTF8NBSP=UTF8NBSP.ReplaceAll(NBSPAsBytes, "@")

…the properly encoded UTF-8 non-breaking space character is replaced with the “@” character when searching for the non-breaking space character as bytes. The character-as-bytes string has a Nil encoding.

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 3833

Trending Articles