.net core cli - build on Linux and Windows - Issues with string comparison and accents - linux

I switched my CI tool to call dotnet build on Linux whereas I was previoulsy doing it on Windows. Then I suddenly had a bug in my app.
I am comparing a variable read from database to a string litteral (directly in the code) returned from a method. The string litteral has French accents. So does the value stored in the db (SQL Server).
However, the line that does the string comparison returns true when built on Windows but false when built from Linux.
How come?
UPDATE
Here the exception message that showed me the issue:
throw new ArgumentOutOfRangeException(nameof(modeDePaiement), modeDePaiement, "Mode de paiement non supporté");
When displaying the error, modeDePaiement was equal to "prélèvement" both when built from Windows or Linux.
However, the value it is compared against AS WELL AS the word "supporté" in the error message weren't displayed equally: when built from Linux the "é" is replaced with some symbol whereas it is correctly displayed when built from Windows.
It seems that strings, in code, are not encoded the same way when built from Linux or Windows.

Related

Problem communicating with 3rd party apps via VBA on Mac M1

I have created a VBA add-in for Microsoft Word. Both a Windows and Mac version. The add-in communicates with 3rd party apps.
This has worked fine for years. I'm now struggling making this work for the Mac-version with M1-based macs (Maybe also Big Sur related).
The communication works partly via a dylib written i c, via stdin and stdout.
Secondly some functions use AppleScriptTask.
I can't make either of these two methods work.
AppleScriptTask always return the error:
Run-time error '5'
Invalid procedure call or argument
VBA-code:
s = AppleScriptTask("WMscript.scpt","Test","")
I tried scripts with .scpt, .scptd and .applescript.
Also newly created scriptfiles with simple test.script:
on Test(paramS)
tell application "Finder"
activate
end tell
end Test
The api works in other applications, but I can't open 3rd party apps in it when used from VBA.
I use these special folders for the all the 3rd party files to circumvent sandboxing for both methods:
/Library/Application support/Microsoft/Office365/User Content/Add-ins/
~/Library/Application Scripts/com.microsoft.word/
~/Library/containers/com.microsoft.word/Data/
I also tried the GrantAccessToMultipleFiles(FileArray) function. It always returns 'True' regardless which filenames are sendt in the array. It never prompt the user.
Running:
M1 Mac
Big sur 11.6 (M1)
Microsoft Word for Mac 16.54 (21101001)
Not sure following will help you.
If your third-party application is from unknown developer, then it goes to GateKeeper quarantine. Try to remove quarantine before calling your VBA script, running following script.
set theApp to application id "Avidemux.org" -- EDIT here the bundle ID
set quotedPath to quoted form of (POSIX path of (path to theApp))
do shell script "xattr -rd com.apple.quarantine " & ¬
quotedPath with administrator privileges
You can include the code above to beginning of your VBA script.
The ApplceScriptTask problem was related to an incorrect path, for the script file:
Incorrect: ~/Library/Application Scripts/com.microsoft.word/
Correct: ~/Library/Application Scripts/com.microsoft.Word/
Had to be Uppercase W.

Pentaho: Binary file (standard input) matches

When I'm trying to use MySQL in Table input with an order by in the query, I'm getting below error and ETL stops abruptly.
Binary file (standard input) matches
If I remove order by in the query, it works. Is this a bug in Pentaho?
And, it occurs only in Linux Environment
I'm using Pentaho 8.1.0.0 CE
OS: Ubuntu 16.04.4 LTS
MySQL Driver version: mysql-connector-java-5.1.46.jar
Checks whether the select is returning a zero date 0000-00-00 00:00:00
If so, add the property zeroDateTimeBehavior=convertToNull in the JDBC parameters
This happened to me also in Ubuntu 16.04 and PDI 8.1 (although it worked fine in Windows 10 and PDI 8.1)
In my case happened by a step that had an accent in the name.
Try to keep the names of the steps simple, without accents or any other fancy characters.

SHGetFolderPath returns incorrect file path for non-English Windows

My application uses SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, szPath) to get the file path for application data. A user reported (via a Survey Monkey survey) a bug as reported below --
"Win XP uses partly a Czech name "C:\Documents and Settings\%my profile%\Data aplikací" The letter í (i with acute) causes a problem: The library.db file cannot be found since the program searches "Data aplikac" instead of the correct "Data aplikací" as I have seen in the File Monitor."
How do I rectify this problem? It is difficult for me to debug the problem without a Czech user I can communicate with.
The application is compiled for MBCS not Unicode.

HelloWorld Deployment with QtQuick 2.0 in Windows 7 and XP

I've been struggling to get my application deployed properly for several weeks now (it's a hobby), and I just don't know what else to try.
I started a new project in Qt Creator (2.6.1), by selecting Applications -> Qt Quick 2 Application (Built-in Elements). I tweaked the QML to make the background blue and text red:
main.qml
import QtQuick 2.0
Rectangle {
width: 360
height: 360
color: "blue" // Added!
Text {
text: qsTr("Hello World")
anchors.centerIn: parent
color: "red" // Added!
}
MouseArea {
anchors.fill: parent
onClicked: {
Qt.quit();
}
}
}
I'm using Qt 5.0.1 and the x86 MSVC 2010 compiler. I built the Release version and it ran fine in QtCreator. If you need more compiler specifics, I'll post them.
To deploy, I created a new folder on my desktop called HelloWorld/ and copied everything from H:\Qt\Qt5.0.1\5.0.1\msvc2010\bin\* and H:\Qt\Qt5.0.1\5.0.1\msvc2010\plugins\* and 'H:\Qt\Qt5.0.1\5.0.1\msvc2010\qml* into it, along with the Release HelloWorld.exe executable.
Overkill? Yes. But I'm desperate.
When I run HelloWorld/HelloWorld.exe in Windows 7 64-bit, the application runs fine. But when I copy this HelloWorld/ folder over into a virtual machine running Windows XP 32-bit, it shows a properly-sized window, but with nothing in it (white, with no text). When clicking in the center of the window, the window closes as it should.
So I loaded the executable in Dependency Walker, but nothing looked out of the ordinary (IESHIMS.DLL and WER.DLL were of course missing). I ran Start Profile, and got a slew of red errors:
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsAlloc") called from "MSVCR100.DLL" at address 0x78ABBA3B and returned NULL. Error: The specified procedure could not be found (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsGetValue") called from "MSVCR100.DLL" at address 0x78ABBA48 and returned NULL. Error: The specified procedure could not be found (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsSetValue") called from "MSVCR100.DLL" at address 0x78ABBA55 and returned NULL. Error: The specified procedure could not be found (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "FlsFree") called from "MSVCR100.DLL" at address 0x78ABBA62 and returned NULL. Error: The specified procedure could not be found (127).
LoadLibraryExW("C:\documents and settings\owner\desktop\helloworld\platforms\qminimald.pdb", 0x00000000, DONT_RESOLVE_DLL_REFERENCES) returned NULL. Error: %1 is not a valid Win32 application (193).
LoadLibraryExW("C:\documents and settings\owner\desktop\helloworld\platforms\qwindowsd.pdb", 0x00000000, DONT_RESOLVE_DLL_REFERENCES) returned NULL. Error: %1 is not a valid Win32 application (193).
GetProcAddress(0x7E410000 [USER32.DLL], "UpdateLayeredWindowIndirect") called from "QWINDOWS.DLL" at address 0x013A8749 and returned NULL. Error: The specified procedure could not be found (127).
GetProcAddress(0x7C9C0000 [SHELL32.DLL], "SHCreateItemFromParsingName") called from "QWINDOWS.DLL" at address 0x013A8997 and returned NULL. Error: The specified procedure could not be found (127).
GetProcAddress(0x7C9C0000 [SHELL32.DLL], "SHGetStockIconInfo") called from "QWINDOWS.DLL" at address 0x013A89C9 and returned NULL. Error: The specified procedure could not be found (127).
GetProcAddress(0x7C800000 [KERNEL32.DLL], "GetTickCount64") called from "QT5CORE.DLL" at address 0x670726A7 and returned NULL. Error: The specified procedure could not be found (127).
GetProcAddress(0x755C0000 [MSCTFIME.IME], "ImeGetImeMenuItems") called from "IMM32.DLL" at address 0x76397354 and returned NULL. Error: The specified procedure could not be found (127).
GetProcAddress(0x4FDD0000 [D3D9.DLL], "Direct3DCreate9Ex") called from "LIBEGL.DLL" at address 0x01487198 and returned NULL. Error: The specified procedure could not be found (127).
I also tried to run a debug version, but I only have the 64-bit versions of the MSVC100 dll's, so I can't copy them to the XP machine (I can only run the 32-bit redistributable). I don't know what other tools I can use to try to solve my problem.
I know I must be doing something stupid, but I really can't find anything on the internet to help. It's really frustrating to spend so much time developing a Qt application, and then get stuck trying to deploy it.
I should note that the program runs just fine in a Windows 7 32-bit virtual machine (after MSVC2012 redistributable has been installed).
The application I'm really interested in running, runs really strangely in Windows XP. When I first run it, the window sizes properly and a couple text strings show up. But none of the Rectangle{} elements are displayed. I left the app running for a few minutes as I made myself some coffee, and when I returned to my computer, the window was blinking random shapes and text, to the beat of the text cursor! What the heck is that?! It looked like a basic math function was screwed up, so parts of the interface were being displayed at improper sizes and positions. I even saw the real interface show up for one blink of the mouse cursor (and yes, the random shapes appear and disappear to the beat of the mouse cursor).
On a whim, I tried using the application (clicking where I know a text box exists), to populate one of the lists, and it worked! The application is running completely fine, except for the graphics. I know Qt 5.0 reworked some of the OpenGL handling, right? Could this be a bug, or maybe a library I haven't installed?
I also encountered the same problem when deploying quick 2.0 application on Windows XP builded by Qt 5.1 rc1 with ANGLE; It's seems to be ANGLE problem, on http://qt-project.org/wiki/Qt-5-on-Windows-ANGLE-and-OpenGL is recommended to use OPENGL for XP, also Qt 5.1 with OPENGL works for me on Windows XP
Install Microsoft Visual C++ 2010 Redistributable Package (x86)
on client machine (windows xp).
Use release build, not debug build, You seems to be using Debug
version.
Don't use OpenGL(Most of XP Users may note have updated OpenGL
version, otherwise‍ you may have to force them to upgrade it.)
Update
Use OpenGL for Windows XP. User have to install or upgrade their OpenGL drivers. Read this.
Try using the MinGW version instead of the VC++ one. It's likely that there are layers and layers of .Net stuff preventing you from running on XP. XP came out before 90% of the current .Net stuff existed which is why it wont work as it's not installed.
Just a guess but its worth a shot.

Return value of c# exe with exec

i have a problem using inno setup. I'm installing an update with inno, and with the update.exe the user get a txtfile with a licencenumber. On his Unit this licencenumber readable by a dll function.
Before the installingprocess i have to compare these numbers. Only if this numbers are identical the user is trying to installing the update on the right machine with the right licence.
If i would put this check into an seperate exe, it would be easy to crack it by change the exe with one just doing nothing (no errorcode). So i want to split the checking into the seperated exe (where i check some other things like installed version number etc.) and the update.exe
In update exe, i want to read the txtfile inside the updatepackage - this is easy.
In check.exe i want to call the internal dll and get the licencenumber of the machine. I have to return this number as an int. C# allows me to do that.
But how can i get this number in innosetup?
I tried to take the errorcode for this (0=error - not right version etc, XXXXXXXXX = licencenumber of machine). But the errorcode is just 2 chars in inno. I get only 2 chars...
Saving the number in another file would'nt be a solution cause the user can crack it this way... Is it possible to get the number into inno without giving the user the chance to manilpulate??
If you move the code into a DLL (either COM or a plain stdcall DLL) then it can be used by Inno and pass extra data between them including full strings, etc.

Resources