summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Fusik <piotr@fusion-lang.org>2024-02-22 17:41:21 +0100
committerPiotr Fusik <piotr@fusion-lang.org>2024-02-22 17:41:21 +0100
commitff3fd0f04e92cbde843f6f8b8bc202fb37e561ea (patch)
treed14b4beb13cea5faaca7d1cd2b919a5a46845a91
parent9646487c12c1c15a6b653883e6332186b3efa7a6 (diff)
[cpp] Fix string.ToLower/ToUpper broken with ICU.
#147
-rw-r--r--GenCpp.fu4
-rw-r--r--libfut.cpp4
-rw-r--r--libfut.cs4
-rw-r--r--libfut.js4
4 files changed, 8 insertions, 8 deletions
diff --git a/GenCpp.fu b/GenCpp.fu
index 06dc5f6..0fe3ece 100644
--- a/GenCpp.fu
+++ b/GenCpp.fu
@@ -2035,7 +2035,7 @@ public class GenCpp : GenCCpp
WriteLine("#include <unicode/unistr.h>");
if (this.StringToLower) {
WriteNewLine();
- WriteLine("static std::string FuString_ToLower(std::string_view str)");
+ WriteLine("static std::string FuString_ToLower(std::string_view s)");
OpenBlock();
WriteLine("std::string result;");
WriteLine("return icu::UnicodeString::fromUTF8(s).toLower().toUTF8String(result);");
@@ -2043,7 +2043,7 @@ public class GenCpp : GenCCpp
}
if (this.StringToUpper) {
WriteNewLine();
- WriteLine("static std::string FuString_ToUpper(std::string_view str)");
+ WriteLine("static std::string FuString_ToUpper(std::string_view s)");
OpenBlock();
WriteLine("std::string result;");
WriteLine("return icu::UnicodeString::fromUTF8(s).toUpper().toUTF8String(result);");
diff --git a/libfut.cpp b/libfut.cpp
index c1917bc..f0c093b 100644
--- a/libfut.cpp
+++ b/libfut.cpp
@@ -14986,7 +14986,7 @@ void GenCpp::writeProgram(const FuProgram * program)
writeLine("#include <unicode/unistr.h>");
if (this->stringToLower) {
writeNewLine();
- writeLine("static std::string FuString_ToLower(std::string_view str)");
+ writeLine("static std::string FuString_ToLower(std::string_view s)");
openBlock();
writeLine("std::string result;");
writeLine("return icu::UnicodeString::fromUTF8(s).toLower().toUTF8String(result);");
@@ -14994,7 +14994,7 @@ void GenCpp::writeProgram(const FuProgram * program)
}
if (this->stringToUpper) {
writeNewLine();
- writeLine("static std::string FuString_ToUpper(std::string_view str)");
+ writeLine("static std::string FuString_ToUpper(std::string_view s)");
openBlock();
writeLine("std::string result;");
writeLine("return icu::UnicodeString::fromUTF8(s).toUpper().toUTF8String(result);");
diff --git a/libfut.cs b/libfut.cs
index d174c61..b32e476 100644
--- a/libfut.cs
+++ b/libfut.cs
@@ -15340,7 +15340,7 @@ namespace Fusion
WriteLine("#include <unicode/unistr.h>");
if (this.StringToLower) {
WriteNewLine();
- WriteLine("static std::string FuString_ToLower(std::string_view str)");
+ WriteLine("static std::string FuString_ToLower(std::string_view s)");
OpenBlock();
WriteLine("std::string result;");
WriteLine("return icu::UnicodeString::fromUTF8(s).toLower().toUTF8String(result);");
@@ -15348,7 +15348,7 @@ namespace Fusion
}
if (this.StringToUpper) {
WriteNewLine();
- WriteLine("static std::string FuString_ToUpper(std::string_view str)");
+ WriteLine("static std::string FuString_ToUpper(std::string_view s)");
OpenBlock();
WriteLine("std::string result;");
WriteLine("return icu::UnicodeString::fromUTF8(s).toUpper().toUTF8String(result);");
diff --git a/libfut.js b/libfut.js
index f995845..f508bea 100644
--- a/libfut.js
+++ b/libfut.js
@@ -15785,7 +15785,7 @@ export class GenCpp extends GenCCpp
this.writeLine("#include <unicode/unistr.h>");
if (this.#stringToLower) {
this.writeNewLine();
- this.writeLine("static std::string FuString_ToLower(std::string_view str)");
+ this.writeLine("static std::string FuString_ToLower(std::string_view s)");
this.openBlock();
this.writeLine("std::string result;");
this.writeLine("return icu::UnicodeString::fromUTF8(s).toLower().toUTF8String(result);");
@@ -15793,7 +15793,7 @@ export class GenCpp extends GenCCpp
}
if (this.#stringToUpper) {
this.writeNewLine();
- this.writeLine("static std::string FuString_ToUpper(std::string_view str)");
+ this.writeLine("static std::string FuString_ToUpper(std::string_view s)");
this.openBlock();
this.writeLine("std::string result;");
this.writeLine("return icu::UnicodeString::fromUTF8(s).toUpper().toUTF8String(result);");