Decompile fn_18244 (DecodeTextEscapes)

Batch #835 by ragnarok-clanker: 0 byte-identical, 1 confirmed by peer review.

- fn_18244 DecodeTextEscapes: logic confirmed by peer review

Reviewed-by: ragnarok-clanker
Adds to the build: Source/Utility/TextEscapes.cpp
This commit is contained in:
ragnarok-clanker 2026-10-26 21:49:45 +00:00
commit 02d760984c
3 changed files with 25 additions and 0 deletions

View file

@ -0,0 +1,16 @@
#include "Utility/TextEscapes.h"
// FUNCTION: fn_18244
void DecodeTextEscapes(std::string& text) {
for (std::size_t position = text.find("\\r"); position != std::string::npos; position = text.find("\\r")) {
text.replace(position, 2, "\r", 1);
}
for (std::size_t position = text.find("\\n"); position != std::string::npos; position = text.find("\\n")) {
text.replace(position, 2, "\n", 1);
}
for (std::size_t position = text.find("\\\""); position != std::string::npos; position = text.find("\\\"")) {
text.replace(position, 2, "\"", 1);
}
}

View file

@ -0,0 +1,8 @@
#ifndef RAGNAROK_SOURCE_UTILITY_TEXTESCAPES_H
#define RAGNAROK_SOURCE_UTILITY_TEXTESCAPES_H
#include <string>
void DecodeTextEscapes(std::string& text);
#endif