Skip to content

Commit

Permalink
Explicitly set the encoding when using Text::Assign
Browse files Browse the repository at this point in the history
See also:
    #215
  • Loading branch information
minstral committed May 20, 2024
1 parent 4da0baf commit 46594f2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Source/BEJavaScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
BEJavaScript.cpp
BaseElements Plug-In
Copyright 2014-2021 Goya. All rights reserved.
Copyright 2014-2024 Goya. All rights reserved.
For conditions of distribution and use please see the copyright notice in BEPlugin.cpp
http://www.goya.com.au/baseelements/plugin
Expand Down Expand Up @@ -101,7 +101,7 @@ static duk_ret_t BE_Evaluate_FileMaker_Calculation ( duk_context *context )
std::string calculation = duk_require_string ( context, 0 );

fmx::TextUniquePtr command;
command->Assign ( calculation.c_str() );
command->Assign ( calculation.c_str(), fmx::Text::kEncoding_UTF8 );

fmx::DataUniquePtr result;
const fmx::ExprEnvUniquePtr environment;
Expand Down
2 changes: 1 addition & 1 deletion Source/BEPluginFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
BEPluginFunctions.cpp
BaseElements Plug-In
Copyright 2010-2023 Goya. All rights reserved.
Copyright 2010-2024 Goya. All rights reserved.
For conditions of distribution and use please see the copyright notice in BEPlugin.cpp
http://www.goya.com.au/baseelements/plugin
Expand Down
12 changes: 6 additions & 6 deletions Source/BEPluginUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
BEPluginUtilities.cpp
BaseElements Plug-In
Copyright 2010-2023 Goya. All rights reserved.
Copyright 2010-2024 Goya. All rights reserved.
For conditions of distribution and use please see the copyright notice in BEPlugin.cpp
http://www.goya.com.au/baseelements/plugin
Expand Down Expand Up @@ -1006,13 +1006,13 @@ errcode ExecuteScript ( const std::string& script_name, const std::string& file_
try {

TextUniquePtr script;
script->Assign ( script_name.c_str() );
script->Assign ( script_name.c_str(), fmx::Text::kEncoding_UTF8 );

TextUniquePtr database;
database->Assign ( file_name.c_str() );
database->Assign ( file_name.c_str(), fmx::Text::kEncoding_UTF8 );

TextUniquePtr filemaker_script_parameter;
filemaker_script_parameter->Assign ( script_parameter.c_str() );
filemaker_script_parameter->Assign ( script_parameter.c_str(), fmx::Text::kEncoding_UTF8 );
DataUniquePtr parameter;
LocaleUniquePtr default_locale;
parameter->SetAsText( *filemaker_script_parameter, *default_locale );
Expand Down Expand Up @@ -1197,10 +1197,10 @@ void Do_GetString ( const unsigned long whichStringID, TextUniquePtr& function_i
function_information->AssignUnicode ( temp_buffer );

TextUniquePtr function_delimiter;
function_delimiter->Assign ( " (" );
function_delimiter->Assign ( " (", fmx::Text::kEncoding_UTF8 );

TextUniquePtr pipe;
pipe->Assign ( "|" );
pipe->Assign ( "|", fmx::Text::kEncoding_UTF8 );
auto pipe_at = function_information->Find ( *pipe, 0 );

switch ( which_string ) {
Expand Down
12 changes: 6 additions & 6 deletions Source/BESQLCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
BESQLCommand.cpp
BaseElements Plug-In
Copyright 2011-2021 Goya. All rights reserved.
Copyright 2011-2024 Goya. All rights reserved.
For conditions of distribution and use please see the copyright notice in BEPlugin.cpp
http://www.goya.com.au/baseelements/plugin
Expand Down Expand Up @@ -31,8 +31,8 @@ BESQLCommand::BESQLCommand ( const Text& _expression, const Text& _filename )

BESQLCommand::BESQLCommand ( const std::string& _expression, const std::string& _filename )
{
expression->Assign ( _expression.c_str() );
filename->Assign ( _filename.c_str() );
expression->Assign ( _expression.c_str(), fmx::Text::kEncoding_UTF8 );
filename->Assign ( _filename.c_str(), fmx::Text::kEncoding_UTF8 );
}


Expand Down Expand Up @@ -167,13 +167,13 @@ void BESQLCommand::set_row_separator ( const Text& new_row_separator )
bool BESQLCommand::is_ddl_command ( void ) const
{
const TextUniquePtr alter;
alter->Assign ( "ALTER" );
alter->Assign ( "ALTER", fmx::Text::kEncoding_UTF8 );

const TextUniquePtr create;
create->Assign ( "CREATE" );
create->Assign ( "CREATE", fmx::Text::kEncoding_UTF8 );

const TextUniquePtr drop;
drop->Assign ( "DROP" );
drop->Assign ( "DROP", fmx::Text::kEncoding_UTF8 );

bool is_ddl = expression->FindIgnoringCase ( *alter, 0 ) == 0 ||
expression->FindIgnoringCase ( *create, 0 ) == 0 ||
Expand Down

0 comments on commit 46594f2

Please sign in to comment.