Replacing English sentences in program dialogues with Bulgarian translations results in text truncation - encoding

I have a very old program (written in the time of Windows XP in C++, I trust). I need to translate certain dialogues of the program from English to Bulgarian. In principle, this can be done via resource file editing. It works just fine with one serious exception. It is only the first half of Bulgarian phrases that is shown after editing, compiling and saving the resource. I realise it has everything to do with encodings (probably, CP1252 is replaced with UTF-8 somehow).
I tried to use software called Resource hacker as well as MS Visual studio to edit the resource, but the problem persists in both cases. Please give me ideas on how this problem can be solved. I am no programmer in any way, so please don't be too laconic :-).

Related

classic look of windows tab control in unicode MFC program?

I am working on an MFC dialog based program with CTabCtrl (VS2017, W10). Everything works as expected, apart from the way tabs look (convoluted story, don't ask).
I need them to look like on the right, but when I created a new project with a CDialogEx based class and added tabs to the dialog (just the standard VS/MFC stuff, nothing fancy yet) they looked like the ones on the left. What I found after some testing and comparing with older projects is that if I switch in project defaults Character Set from Unicode to Multi-Byte Character Set I get the look I want (yes, sounds completely unrelated, but checked and rechecked several times). But that's ridiculously inconvenient, program needs to work with different languages and uses Unicode libraries for managing the data.
No idea if the problem is really MFC related, could be some deeper Windows thing.
Any idea what can be done to get the right look (pun intended), other than implementing my own OwnerDraw() or adding an additional layer of code to translate between data in Unicode and MBCS? Both approaches sound pretty off.

How to paste text with links and formatting into VS Code like Obsidian?

If I copy the above text from Chrome and paste it into Obsidian, I get
People who code: we want your input. [Take the Survey](https://stackoverflow.com/dev-survey/start?utm_source=so-owned&utm_medium=announcement-banner&utm_campaign=dev-survey-2021)
[](https://stackoverflow.com/questions/ask# "dismiss")
But when I paste into VS Code or any other editor, I get
People who code: we want your input. Take the Survey
Video Reference: https://dsc.cloud/J/67968285.mov
How does Obsidian do it? How can I achieve the same in VS Code?
— — — — — — — — — — — — — — — — — — — — — — — — —
The Short Answer:
"        The VSCode editor does not support the feature you described, and VSCode will almost certainly never support any functionality that comes close to it. This is because of what VSCode is, and what VSCode does, which I will explain in detail below."
The Long Answer:
So VS-Code is a text-based editor, and its purpose is to be an environment that programmers can write their code in, therefore, people using VSCode are going to preform a long list of tasks which includes, but is not limited to:
interpret, compile, execute, debug, serve, share, save, write, read, document, and run code. Now here is the problem with adding the ability to paste arbitrary data types into VSCode. Having any type of data, other than standard text in a file that you plan on using to do one of the following (this is the very short list)...
compile,
execute,
debug,
interpret
parse,
serve,
...will cause a syntax error to be thrown.
When you can copy, and paste, text-formatting from an external source (like a webpage), there is an extremely high probability that some unwanted formatting data will get pasted into some program you've written, and the text's format-data will end up not rendering for what ever reason (theirs a million and 87 reasons why that would happen), and you end up getting syntax errors that you can't see, so you now have no idea where the error is, despite the error message saying line number 734 column 24. In a situation like this you will have an error message that makes no sense, and you will have to start deleting things to find the issue. all because it has text-formatting data intertwined with standard text-data, which you can't see. I hope I drew a clear enough picture for you.
Their are other tools called word processors that implement this feature. I constantly couple G-Docs with VSCode.
Crazy Enough, not all is lost
VSCode allows extensions to make custom editors. The Extension API used to create an editor (can be seen by clicking the link) lets developers build the UI using standard HTML, CSS, and JavaScript. This is enough for someone to write a Word Processor for VSCode, which surprisingly no one has done yet. When someone does create one, which I am almost certain that someone will eventually, in could support the feature your asking for.
For the record, the feature your describing is typically a word processor thing. VSCode allows you to install extensions such as PASTE, which copies and pastes other data types, however; when it is pasted into the editor, instead of rendering the data types like HTML, it just writes it in its text format. In other words, you might think your copying the page at first, but you will be disappointed once you paste to VSCode. I want to point out that Paste uses the GTK-3 Clipboards API, which means that if Paste were to be implemented in a word-processor, like word, or Google docs, those word processors would render the data the the Paste extension pasted into the word processor. In other words, it isn't the extension that is failing to render the Data (which as stated, can be done with the Paste Extension), but its VSCode that wonder render that data as HTML, but only accepts it as a standard text data type.
#W3Dojo
What you've copied can be considered "rich text", but VSCode treats everything in your clipboard as plain text.
So it's the same as pasting via "Ctrl+Shift+V" in other programs like Word or Google Docs. It will remove any formatting, links, color, font, bold/italic, etc.
Obsidian was built with formatting in mind - it closely follows the markdown specification, so it's natural that it will try to convert any rich text to markdown.
I'm not aware of a built-in VSCode setting that will allow you to paste rich text, but I've found 2 extensions that might do the trick:
Paste Special
Markdown Paste

Japanese characters displaying as random symbols

I have a Japanese program, but when I try to run it all the Japanese characters turn into random symbols like in the link to the picture
http://puu.sh/avcAp/04de126564.png
I've tried searching for answers but I only see ways to fix it if it shows up as blank rectangles and not the random symbols I'm getting.
You can see little bits of english just fine though, like in the link, you can see the .exe ... (I'm trying to install it but there's an error and since it's all these random symbols I have no idea what it means.)
Edit:
I'm running Windows 7 Ultimate. This is a program I downloaded online, but I'm sure it's not broken. The symbols in the picture are a screenshot from an error window (The windows default one with a red X on the left), however all the text that's related to that program that is Japanese is also random symbols, and my picture is just an example.
Edit 2:
Here is a better image
http://puu.sh/aveXV/7d15ecf2d4.png
Where you can see some Japanese characters, but some are random characters. This is when I first run the .exe to install and it's asking for what directory I want to install to
Thanks for your help in advance
It sounds like a non-Unicode program. It's not ideal, but you can change your non-Unicode program language in Region and Language settings in Control Panel to Japanese (requires reboot).
It only affects non-Unicode programs, so most modern English programs will be unaffected. I've changed mine to Chinese (PRC) and the only program I noticed affected was "cmd.exe". It allowed me to type and display Chinese at the console.

Why does my system not display unicode correctly?

I wrote this question and it turns out the code is correct but it doesnt display properly on my system. I dont understand! why might it do this? My system is set to united states english. I dont know what the problem can be.
This makes it difficult to develop unicode apps when it doesn't display properly on my system :(
-Edit- To be more clear. I made a winform app using .NET and the text appears incorrect on my machine but works on others. I can copy/paste text into my app but i wont know if it ran correctly since i see nonsense instead of text. However most unicode works. Special chars (like >16bits) does not.
I assume from the question you linked to that you are on a windows machine. The problem could be that windows does not have a global encoding option at all. The united states english is a language setting which as far as I know does not mean what you expect it to mean, as in it does not set all of your programs to show text in a unicode format.
The quick answer is that especially in windows, each program that displays text to the user is responsible for the character encoding. You have to make sure that the program and the environment where the problem appears are set to display text using some unicode format, such as UTF-8.
Read up on Unicode and UTF-8

What exactly happens when Complex Script Support is enabled?

When we click the check box "Install files for complex script and right to left languages (including Thai)" in Regional and Language settings what exactly happens?
Changes to registry keys?
I noticed that it installs some .fon files and keyboard dlls.
Is this totally necessary if one just wish to read complex script on Windows XP? My test inside VirtualBox as Windows 7 as the host OS seems to indicate that for reading Complex Script need not be enabled. Yet that's not what all the literature on the subject says. What's going on?
Update:
http://hi.wikipedia.org should not be readable if Complex Script is not enabled
http://hi.wikipedia.org/wiki/विकिपीडिया:Devanagari_Help
Problem is that it is readable.
Font files. Rendering libraries ('Uniscript'). Input methods. Certainment beaucoup de cle-registry. (Certainly lots-o-registry-keys.)
Note that IE will tend to get things right even when other things don't, since it builds in a good deal of fancy-pants rendering. Try, oh, Outlook, or some simple sample Win32 program.