Search
Setup for Free
S
Silk.NET
•
3y ago
Maxine
php strings are just data
php strings are just data
Silk.NET
Join
A Discord server for the Silk.NET - your one-stop-shop for high-speed .NET multimedia, graphics, and compute. FOSS.
1,790
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
L
Lyris the Kitori
•
10/7/23, 10:27 PM
ユ
ニ
コ
ー
ド
M
Maxine
php strings are just data
A
Aqua
•
10/7/23, 10:28 PM
that
-
what
-
uhm
-
i mean
yes
?
but
the number 1 is also data
M
Maxine
OP
•
10/7/23, 10:28 PM
nonononono
L
Lyris the Kitori
•
10/7/23, 10:28 PM
they are just data
M
Maxine
OP
•
10/7/23, 10:28 PM
php strings are just byte arrays
M
Maxine
OP
•
10/7/23, 10:28 PM
and php builtin functions have no notion of encoding
A
Aqua
•
10/7/23, 10:28 PM
that is the case in most languages
A
Aqua
•
10/7/23, 10:28 PM
ah
A
Aqua
•
10/7/23, 10:28 PM
well
A
Aqua
•
10/7/23, 10:28 PM
php is just built different
L
Lyris the Kitori
•
10/7/23, 10:29 PM
at least with a language like zig which does that
, the whole stdlib specifies and only accepts UTF
-8 aside from windows functions which need UTF
-16
(which isnt stored as byte arrays anyway
, so its clearly incompatible
)
M
Maxine
OP
•
10/7/23, 10:29 PM
if you do indexOf
(
'
ッ
'
) you get a different result depending on the encoding of the source code and the encoding of the string when it was read
L
Lyris the Kitori
•
10/7/23, 10:30 PM
aw man i love shift
-jis
L
Lyris the Kitori
•
10/7/23, 10:30 PM
GREAT invention
L
Lyris the Kitori
•
10/7/23, 10:30 PM
totally hasnt haunted me for years
M
Maxine
OP
•
10/7/23, 10:30 PM
it could be
\xE3
\x83
\x83
\x30
\xC3
or whatever it is in shift
-jis
L
Lyris the Kitori
•
10/7/23, 10:30 PM
zig
's solution to the problem is
: if your source code is not UTF
-8 its a compile error
A
Aqua
•
10/7/23, 10:30 PM
as it should
M
Maxine
OP
•
10/7/23, 10:30 PM
good
L
Lyris the Kitori
•
10/7/23, 10:30 PM
yup
A
Aqua
•
10/7/23, 10:31 PM
oh yeah
A
Aqua
•
10/7/23, 10:31 PM
side note
A
Aqua
•
10/7/23, 10:31 PM
really annoying thing in rust
A
Aqua
•
10/7/23, 10:31 PM
you can
't index strings
L
Lyris the Kitori
•
10/7/23, 10:31 PM
is rust
A
Aqua
•
10/7/23, 10:31 PM
why
? because fuck you
A
Aqua
•
10/7/23, 10:31 PM
this is causing me major pain
M
Maxine
OP
•
10/7/23, 10:31 PM
is it bc they are null terminated
A
Aqua
•
10/7/23, 10:31 PM
no
M
Maxine
OP
•
10/7/23, 10:31 PM
what
A
Aqua
•
10/7/23, 10:31 PM
its because char is variable in size
A
Aqua
•
10/7/23, 10:31 PM
so
L
Lyris the Kitori
•
10/7/23, 10:31 PM
well
, what does
"index string
" mean
, codepoints
, bytes
?
A
Aqua
•
10/7/23, 10:31 PM
that causes problems for some reason
A
Aqua
its because char is variable in size
M
Maxine
OP
•
10/7/23, 10:31 PM
fdsouighdfasjgjasdfhghdsfgs
M
Maxine
OP
•
10/7/23, 10:31 PM
what encoding is a rust string
?
?
L
Lyris the Kitori
well, what does "index string" mean, codepoints, bytes?
A
Aqua
•
10/7/23, 10:31 PM
string[1]
string[1]
M
Maxine
OP
•
10/7/23, 10:32 PM
does its size vary
?
?
M
Maxine
what encoding is a rust string??
A
Aqua
•
10/7/23, 10:32 PM
apparently
?
? i don
't know
A
Aqua
`string[1]`
L
Lyris the Kitori
•
10/7/23, 10:32 PM
what does that mean
?
A
Aqua
•
10/7/23, 10:32 PM
char c = mystring[1]
char c = mystring[1]
c == 's'
c == 's'
L
Lyris the Kitori
•
10/7/23, 10:32 PM
so you want codepoints
?
L
Lyris the Kitori
•
10/7/23, 10:32 PM
or characters
A
Aqua
•
10/7/23, 10:32 PM
characters
L
Lyris the Kitori
•
10/7/23, 10:32 PM
that isnt a hard fast definition in unicode
L
Lyris the Kitori
•
10/7/23, 10:33 PM
also how big is said
char
char
type
? itd have to be at least 21 bits long to fit all codepoints
A
Aqua
•
10/7/23, 10:33 PM
i don
't remember its size in rust
L
Lyris the Kitori
•
10/7/23, 10:34 PM
in rust
, chars are unicode scalar value
, and are 4 bytes in size
L
Lyris the Kitori
•
10/7/23, 10:34 PM
according to the docs
L
Lyris the Kitori
•
10/7/23, 10:34 PM
https://doc.rust-lang.org/std/primitive.char.html
char - Rust
A character type
.
Next page
string[1]
string[1]
char c = mystring[1]
char c = mystring[1]
c == 's'
c == 's'
Similar Threads
CI + dotnet tooling is just... different
S
Silk.NET / team-talk
4y ago