NancyFx: static file not found when file name has a plus sign - macos

I'm running NancyFx on Mono/ASP.NET (Mac OS X) and currently I am not able to retrieve a file that contains a plus sign in its filename. All other files without a symbol work fine and I've confirmed it is not a permission issue.
+1.png is the file's name. I've tried making a request to get %2B1.png instead and it did not work.
I'm probably missing something obvious. Help? :)

Related

Qt Target with special characters

I have a QT application and right know I need to change the app name to something like "A&B".
I have tried to change the TARGET in my .pro file, but I am having problems with the "&" character in macOS.
I have also tried to use qmake functions like val_escape, system_quote, shell_quote but nothing worked for me.
As a last resource, I have tried to change the CFBundleName in my .plist file, which worked for app menus and etc, but not for the app name (still having problems with &, as make is considering the app to be called B.app instead of A&B.app
Do you know any other way to get this problem fixed? Is there even a way to have a macOS application with a name like A&B.app?
Thanks in advance
I dont think you are following the right approach. What the client want is perhaps change the "user visible" strings for the application name to "A&B" - for that you need to check out the following functions in QCoreApplication:
applicationName : QString
applicationVersion : QString
organizationDomain : QString
I fixed this by adding a DisplayName to my configuration and changing the applicationDisplayName in the Info.plist.
Thanks anyway.

Cocos desktop app can not access to files on MacOS

I have an application with the following structure:
./Data/test.txt
./TestMacOSApp
So my TestMacOSApp opens ./Data/test.txt and uses the content of test.txt. This app was working for a long time either on my MacBook or others MacBook. Recently I noticed that the app works on my MacBook fine,
but on others it crashes throwing "File is not found exception".
I create TestMacOSApp using XCode v9.1.
MacOS version is 10.12.6.
The App creation steps are Archive->Export->ExportApp (Without re-signing).
Does someone else have such an issue?
How can I solve this issue?
I don't know how you open the file because you didn't provide the code which does this.
But I know that, when you export your app on other computers, it is important to calculate the real path with fullPathForFilename, instead of giving directly the path that you know. Like this:
auto fileUtils = FileUtils::getInstance();
string content = fileUtils->getStringFromFile(fileUtils->fullPathForFilename(filename));
Have you done this? If you have, and it doesn't work, your file is probably just not where you expect it to be, so please check again.

Cannot delete mac alias file

I am having severe issue with mac alias. I have ana xcode project working fine except recently it denied to find a View controller class ("A.swift") to set in storyboard. Tried many tweaks with zero results. Finally I searched in finder in my main project directory for that view controller file name, and I found that I have some alias file as well for that view controller.
I cannot delete that alias, cannot locate the original file (no information in Get Info, Select New Original... is grayed).
Any help for this?
Note: I have two A.swift files for Mac OS and iOS, both in different directories.
Give it a try with rollback/checkout you last changes if you haven't made big.

OS X Firefox lockPref configuration error

I am having issues getting lockPref working on my Mac. I have followed instructions here, as well as looking in other places for solutions. I have created a mozilla.cfg file, as well as a local-settings.js file in /Applications/Firefox/Contents/Resources/defaults/pref, as follows:
mozilla.cfg
//
lockPref("extensions.shownSelectionUI", true);
lockPref("extensions.autoDisableScopes", 11);
local-settings.js
pref("general.config.obscure_value", 0);
pref("general.config.filename", "mozilla.cfg");
These are both saved using Windows Latin encoding (have tried Windows Roman too). When opening Firefox, I am getting an error dialogue saying, "Failed to read the configuration file. Please contact your system administrator". I'm not sure where to go from here, as other solutions have involved UTF encoding problems and incorrect configuration values - I saved an empty mozilla.cfg file to attempt to rule that out, and the problem still persists.
FYI I'm using OS X 10.11.5 and Firefox 42.0. Thanks.
So, I didn't have mozilla.cfg in the correct location - I was storing it in the prefs folder with the local-settings.js, which is incorrect.
File locations are now as follows:
/Applications/Firefox.app/Contents/Resources/mozilla.cfg
/Applications/Firefox.app/Contents/Resources/defaults/pref/local-settings.js

xcode localized string not loaded

I have met a strange problem with the localized strings. I have only a 'Localizable.strings' in my 'en.lproj' folder and it works fine. all the strings are shown on device. but the next time i compile it and run, it shows only the ID of the strings. even if i change nothing and only click on build&debug. and the next time it works fine again and next time again shown with IDs.
so does anyone knows why this is happening? it's kind of annoying that i always need to build twice.
My SOLUTION is at bottom:
I've been running into the same problem: Alternating runs yield correct, then incorrect translations (only for English though).
Adding "-NSShowNonLocalizedStrings YES" as an argument to the app yielded:
Localizable string "MyKey" not found in strings table "Localizable" of bundle CFBundle
So, I tried loading the key file directly from the bundle as a string and dumping it. Well, the times it did NOT work correctly, it was displaying a bunch of built-in iOS messages. So, I went to the APP file that was built, opened the package contents, and viewed the en.lproj/Localizable.strings file...and voila!!! The file had been filled with Apple iOS key/value pairs. On the next build, it was filled as expected.
Of course, this has nothing to do with the encoding of the files (which should be UTF-16). I have not been able to locate anything with mention of this specific problem.
MY SOLUTION:
I copied the contents of the legitimate english Localizable.strings file FROM THE APP PACKAGE (not from my source) into an XML file (when compiled, the .strings file are converted into XML) and added to my project. I then loaded this file into a dictionary at startup, and if the call to NSLocalizedString returned the key instead of the value, I did a lookup on the dictionary I loaded. In theory, you could do this for all languages, but I was only having the problem with english.
Yes, it's not the answer to the problem, but it's a workaround.
Check if you have more than one Localizable.strings in your project. Merging them into one solved it for me. (Check any external code you use e.g. ShareKit)

Resources