I want to add Arabic typing in VB.Net. How can I do that?
It already supports it; it's all unicode under the hood now. If your users have an arabic keyboard layout the standard controls and inputs should accept arabic text. You do need to make sure to use a system that supports unicode for any persistence you use (database, config files, etc), but the vb.net layer should already work.
Related
My use case is as such: my web application is only available in English and we are using the font Nunito. Some people write within the app with characters from other alphabets, but it works, I guess because the browser automatically changes the font. So for example if I write this, it works: γεια σας สวัสดี 你好 Helló ሰላም صباح الخير
But you can make a PDF export from my app, and I had to declare the font for the export, so of course now the characters not included in Nunito are replaced with blank rectangles.
I want the PDF export to display all the characters, and I know the font Noto is available in a lot of languages with different alphabets, but the thing is, as I said, our app is only available in English, so I cannot use a specific font depending on the selected language, and even if it was possible, that wouldn't fix the problem when mixing different alphabets.
So my question is: is there a single font that includes "a lot of" alphabets; or is there a way to load different fonts (such as all the Noto variants) and add a mechanism that chooses the best one for every character (something like a fallback from font to font, like I guess the browsers do)?
What is the actual encoding used in Access' VBA editor? I have been searching for a concrete answer for quite a while but with no luck.
I thought it was UTF-8 but I'm not very certain.
My main issue is that when writing a query in VBA I sometimes need to test it in Access' query editor. When copy-pasting however, I lose my native characters (greek in my case) as they turn to gibberish.
I have tried pasting in a text editor and saving it as different encodings but I can never recover the original characters.
Thanks in advance.
Edit
Let me explain this a bit further:
As you can see I can write my greek characters in the VBA editor normally:
However, copying the first line in Access' query editor, I get the following:
Same goes for a simple text editor:
So I am inclined to think that the problem lies inside the clipboard, due to the encoding used for the greek characters. I guess they are not Unicode, as I indeed have to make the change in the System Locale for non-unicode characters. So how are these characters saved/copied? In what encoding?
Answer
Actually this problem was solved by switching the keyboard input language to greek (EL), when copying the actual test string.
I am still not sure however, as to why that happens. If anyone can provide some insight into this, I would love to hear it.
Thanks again
The VBA editor does not support Unicode characters, either for input or display. Instead, it uses the older Windows technology called "code pages" to provide support for non-ASCII characters.
So, the character encoding in the VBA editor corresponds to the code page that is used by the Windows system locale as specified in the "Regional and Language Options" control panel. For example, with my system locale set to "Greek (Greece)"
I can enter Greek characters into my VBA code
However, if I switch my Windows system locale back to "English (United States)"
and re-open my VBA project, the Greek characters have changed to the corresponding characters in the new code page
If "Control Panel" -> "Regional and Language Options" -> "System Locale" is set correctly but you still suffer from this problem some times then note that while you're copying your keyboard layout must be switched to the non-English language.
This is applicable to all non-unicode-aware applications not only VBA.
Credit goes to #parakmiakos
details in this: http://www.pcreview.co.uk/forums/use-greek-characters-visual-basic-editor-t2097705.html
Looks like making sure your OS is set properly, and font choice inside the VBA editor.
I had a similar problem with Cyrillic characters. Part of the problem is solved when set the System locale correctly.
However, The VBA editor still does not recognize cyrillic characters when it has to interpret them from inside itself.
For example it can not display characters from the command:
Msgbox "Здравей"
but if the sheet name is in cyrillic characters it does it well:
Msgbox Activesheet.Name
Finally, it turned out that these kind of problems were solved when I changed to 32 bits version of MS Office.
In VB.NET, I want to allow typing of non English Characters (For example, Russian, Turkish) in text box. How can I achieve this? Please let me know.
I believe richtextbox allows for that. You're talking about accents and umlauts right?
If so, I'm pretty sure if you just resize your richtextbox down to the size of your textbox then you'll be alright.
If that doesn't work try importing a language pack resource. Use MSDN for specific ones.
Hope that helped
We currently have some quite old code that creates PDFs (without third-party library help), and that needs to write Arabic.
While we have figured out how to make them appear correctly in the PDF viewer, with the correct font definitions and all, we found that the Arabic characters are appearing in their isolated form and aren't shaping, even when placed next to each other.
Does PDF viewer perform Arabic shaping, and how can I enable it?
If it doesn't, does that mean I have to write the Presentation form Unicode of the characters directly onto the PDF, rather than their isolated form?
Thanks!
1: No. PDF is about as "as is" as it gets.
2: That's correct. Welcome to ligature hell.
Having said that, there are quite a few PDF libraries that will handle Arabic ligatures for you. I'm partial to iText myself, but I'm biased (committer).
PDFLIb library does the complex script shaping, for all the languages.
Hi there fellow programmers..
i am using Web Browser control in VB.net 2005, the application i wrote shows a webpage on my computer which has 2 text areas, one for input, and the other for output.
my problem is, i need the charset of the whole program to be unicode, coz the charset of the webpage is utf8. and right now, when i process the input text, the output looks like this:
undefinedundifinedundefinedundifinedundefinedundifinedundefinedundifined
any ideas about how i can change the input language of the entire program to utf-8 or unicode ?
thanks
never mind, turned out the program already accepts unicode input, its the javascript inside the webpage that i am using that's creating the error..