Win 10: Desktop.ini infotip/tooltip text formatting - line break - windows

I'm trying to customize some folders in Windows 10 os using Desktop.ini text files. One thing I can't solve is how to make a line break in the infotip.
Current text file looks like this:
[.ShellClassInfo]
ConfirmFileOp=0
NoSharing=1
IconFile=$path_to_icon
IconIndex=0
InfoTip=Line1 \n Line2
So the last line of the text document is not working as desired. It just doesn't recognize the \n symbol. I also tried replacing the standard \n new line symbol with unicode characters and some other similar methods and symbols, but it didn't work. It just recognizes it as a string no matter what is written there.
The only way I could achieve a line break was to add so many characters, that Win 10 would automatically start a new line.
Help is much appreciated. Thank you!

You could define a string in a resource-only DLL:
InfoTip=#Your.dll,-12345
The negative number defines the resource ID of the string to use.
String resources in a DLL are not limited in the range of character codes, so this should in principle enable you to use line breaks (ASCII code 10).
To create such a resource-only DLL there are many free tools available, google for "windows resource editor".

Related

Start firefox from a terminal window, open a text file and position the text shown at a specified line

I would like to improve the help facility in a Fortran program by opening the user guide in a separate browser (Firefox) window whenever the user type a ?
as answer to a question the program asks.
I can use call system('path/firefox -file user_guide.hlp')
to open the help file. But additionally I would like to position the text in the browser window at a specified line in the help text.
I know which lines in the help file that should be relevant for the user because inside the Fortran program I keep track of the commands the user has made (I use a command line interface, no GUI). At present I print these lines in the terminal window running the program but this limits the amount of lines I can print and obscures the program output. With the whole user guide available in a separate window the user may also easily search for additional explanations elsewhere in the user guide, I do not expect he or she will voluntarily read the user guide.
Thanks for any help
Bo Sundman
You cannot go to specific lines but you could try using named anchor tabs. In the help file,
<a name="1"/>
help topic 1
<a name="2"/>
help topic 2
When you issue your call to firefox, to go to anchor 2
system('path/firefox -file user_guide.html#2')
This should work on all browsers. The newer ones will also take id= instead of name=
EDIT
If the above doesn't work, try
system('path/firefox "file://path/user_guide.html#2"')
EDIT 2
If both the firefox path and html file path have spaces, on Windows, 8.3 filenames can be used. Use dir/x to find out what the 8.3 filenames are. Alternatively filenames with spaces can be used; the syntax is pretty weird
call execute_command_line('""C:\...\firefox.exe" "file://x:\...\userguide.html#2""')
start string with '
Use 2 double quotes for the first double quote ""
Add your pathname to firefox
Use 1 double quote to terminate the path name
add a space
Use 1 double quote to start the parameter
Add the parameter
Use 2 double quotes to terminate
end the string with '

Notepad++ - Binary text error

I have a huge txt file made using python. When I'm trying to sort it using Notepad++/TextFX it returns error: This tool is not compatible with binary text. Please select text without [NUL] characters.. Does it means that I have non-printable chars in this txt file? Is it possible to convert this file to compatible format so I could sort it using TextFX?
EDIT: I used mode 'a' in Python to write this file.
Thank you for your advices.
using TextFX in Notepad++ you could try the following:
Mark the suspicious part or the whole text
Select TextFX, TextFX Characters, Zap all nonprintable characters to #. (The last entry in that submenu.)
All the problematic characters should have been replaced with "#", you can then search for "#".
Another idea is the function: Search, "Find characters in range". Check "My range:" and enter "0" and "0" as range, to find [Nul] characters.
Lars

Terminal overwriting same line when too long

In my terminal, when I'm typing over the end of a line, rather than start a new line, my new characters overwrite the beginning of the same line.
I have seen many StackOverflow questions on this topic, but none of them have helped me. Most have something to do with improperly bracketed colors, but as far as I can tell, my PS1 looks fine.
Here it is below, generated using bash -x:
PS1='\[\033[01;32m\]\w \[\033[1;36m\]☔︎ \[\033[00m\] '
Yes, that is in fact an umbrella with rain; I have my Bash prompt update with the weather using a script I wrote.
EDIT:
My BashWeather script actually can put any one of a few weather characters, so it would be great if we could solve for all of these, or come up with some other solution:
☂☃☽☀︎☔︎
If the umbrella with rain is particularly problematic, I can change that to the regular umbrella without issue.
The symbol being printed ☔︎ consists of two Unicode codepoints: U+2614 (UMBRELLA WITH RAIN DROPS) and U+FE0E (VARIATION SELECTOR-15). The second of these is a zero-length qualifier, which is intended to enforce "text style", as opposed to "emoji style", on the preceding symbol. If you're viewing this with a font can distinguish the two styles, the following might be the emoji version: ☔︉ Otherwise, you can see a table of text and emoji variants in Working Group document N4182 (the umbrella is near the top of page 3).
In theory, U+FE0E should be recognized as a zero-length codepoint, like any other combining character. However, it will not hurt to surround the variant selector in PS1 with the "non-printing" escape sequence \[…\].
It's a bit awkward to paste an isolated variant selector directly into a file, so I'd recommend using bash's unicode-escape feature:
WEATHERCHAR=$'\u2614\[\ufe0e\]'
#...
PS1=...${WEATHERCHAR}...
Note that \[ and \] are interpreted before parameter expansion, so WEATHERCHAR as defined above cannot be dynamically inserted into the prompt. An alternative would be to make the dynamically-inserted character just the $'\u2614' umbrella (or whatever), and insert the $'\[\ufe0e\]' in the prompt template along with the terminal color codes, etc.
Of course, it is entirely possible that the variant indicator isn't needed at all. It certainly makes no useful difference on my Ubuntu system, where the terminal font I use (Deja Vu Sans Mono) renders both variants with a box around the umbrella, which is simply distracting, while the fonts used in my browser seem to render the umbrella identically with and without variants. But YMMV.
This almost works for me, so should probably not be considered a complete solution. This is a stripped down prompt that consists of only an umbrella and a space:
PS1='\342\230\[\224\357\270\] '
I use the octal escapes for the UTF-8 encoding of the umbrella character, putting the last three bytes inside \[...\] so that bash doesn't think they take up space on the screen. I initially put the last four bytes in, but at least in my terminal, there is a display error where the umbrella is followed by an extra character (the question-mark-in-a-diamond glyph for missing characters), so the umbrella really does occupy two spaces.
This could be an issue with bash and 5-byte UTF-8 sequences; using a character with a 4-byte UTF-encoding poses no problem:
# U+10400 DESERET CAPITAL LETTER LONG I
# (looks like a lowercase delta)
PS1='\360\220\220\200 '

How to get a file in Windows with a colon in the filename?

I am getting errors from customers who are uploading files with a colon in the file name, i.e. C:/uploads/test : doc.html
I assume that some Unix or Linux system is generating the file but I'm not sure how the users are saving them with the invalid filename. I have coded a piece that should rename the document on upload. My problem is that I can't test it because I can't get a file on Windows that has a colon in the filename.
I found a very similar character to a colon, "꞉" it is a unicode character called a Modifier Letter Colon. This has no space like the fullwidth colon and is pretty much exactly the same as a regular colon but the symbol works. You can either copy and paste it from above or you can use the code point, U+A789
A colon is an invalid character for a Windows file name. You won't be able to allow ':' in the file name, but you can work around it.
You can either do what it sounds like you have already done; create a script that replaces these invalid characters with valid ones on the UNIX side. Or, you can take care of this on the Windows server with File Name Character Translation: http://support.microsoft.com/kb/289627
Other replacements I've found for reserved characters are
” ‹ › ⁎ ∕ ⑊ \︖ ꞉ ⏐
For example in python you could do:
fixed_name = orig_name.replace('\\\\','⑊')
forbidden_characters = '"*/:<>?\|'
unicode_characters = '”⁎∕꞉‹›︖\⏐'
for a, b in zip(forbidden_characters, unicode_characters):
fixed_name = fixed_name.replace(a, b)
It's probable from the filename you provided that the character you have in your filenames is not a literal colon :, which is a reserved character in Windows filenames, but a fullwidth colon : Instead. It's a Unicode character that looks very much like a colon, visually surrounded by spaces that you can't remove. You can handle it the very same way as any Unicode chacter, the code point is U+FF1A.
You can use the CJK(Chinese/Japan/Korean) one
":"
which is pretty generic.
Currently, you would use WSL, url for instructions: https://learn.microsoft.com/en-us/windows/wsl/install-win10.
You could then create a colon in your Linux Distro.
HOW TO NAME A FILE OR FOLDER USING A SYMBOL THAT LOOKS LIKE A COLON
In the example below, the font size is 12, with the exception of the symbol, which is set to Subscript, Bold and a font size of 16. The character code for the colon-like symbol is 02F8.
The reason for the Subscript setting is to position the symbol lower relative to its vertical position. The bold and larger font settings are applied so that the symbol is more discernible on the page, and have no affect when used in a file or folder name.
Example: (C˸) Symbol – Subscript, Calibri, Bold and font size of 16.
*Using Windows 7, and Word 2007

What's the most reliable way to parse a piece of text out into paragraphs in RealBasic that will work on Windows, Mac, and Linux?

I'm writing a piece of software using RealBASIC 2011r3 and need a reliable, cross-platform way to break a string out into paragraphs. I've been using the following but it only seems to work on Linux:
dim pTemp() as string
pTemp = Split(txtOriginalArticle.Text, EndOfLine + EndOfLine)
When I try this on my Mac it returns it all as a single paragraph. What's the best way to make this work reliably on all three build targets that RB supports?
EndofLine changes depending upon platform and depending upon the platform that created the string. You'll need to check for the type of EndOfLine in the string. I believe it's sMyString.EndOfLineType. Once you know what it is you can then split on it.
There are further properties for the EndOfLine. It can be EndOfLine.Macintosh/Windows/Unix.
EndOfLine docs: http://docs.realsoftware.com/index.php/EndOfLine
I almost always search for and replace the combinations of line break characters before continuing. I'll usually do a few lines of:
yourString = replaceAll(yourString,chr(10)+chr(13),"<someLineBreakHolderString>")
yourString = replaceAll(yourString,chr(13)+chr(10),"<someLineBreakHolderString>")
yourString = replaceAll(yourString,chr(10),"<someLineBreakHolderString>")
yourString = replaceAll(yourString,chr(13),"<someLineBreakHolderString>")
The order here matters (do 10+13 before an individual 10) because you don't want to end up replacing a line break that contains a 10 and a 13 with two of your line break holders.
It's a bit cumbersome and I wouldn't recommend using it to actually modify the original string, but it definitely helps to convert all of the line breaks to the same item before attempting to further parse the string.

Resources