Arabic characters don't show in excel VBA code - excel

I can't write arabic strings in VBA code in excel, it shows as weird characters. Tried it on many machines with excel 2013 or 2010, on windows 8 or windows 7, with or without arabic proofing tools installed. Arabic language is already installed on all machines, system locale is arabic. There's no problem typing arabic characters on excel worksheets or even MS word but not in VBA code.

in VB Editor:
1- click Tools
2- select Options...
3- click Editor Format
4- change font to Courier New (Arabic)
5- click OK
now you can write in both English and Arabic
I hope this will solve your problem

In Windows XP:
> Control Panel
> Regional and Language Options
> Advanced Tab
> Select Arabic (depending on your country) You will be asked to insert the Windows CD, insert it and then browse to the I386 Folder then press ok.
> restart the PC and it should work now fine.
I beleve it's the same on Windows 7, the whole problem is in the non-unicode programs section set it to Arabic.

In win 10, you must change your system locale to match your language. You can find it here:
1- Press win key or click on it
2- Type region and click on it when windows finds it
3- Choose administrative tab
4- Under the language for non-unicode programs you will find "change system locale" key
5- A restart would be required

Related

Using ALT+Click to select text in columns with Notepad++ (Linux)

I run Notepad++ both in Windows, and in Linux under Wine. In Windows, I can hold Alt and click/drag to select characters in a column rather than line-by-line.
In Linux, holding Alt and clicking doesn't select anything. Rather, it makes the cursor a hand tool which drags the window around.
Is there a setting to toggle on the alt-click column highlighting? I've poked around in the settings and keyboard shortcuts, but didn't find anything that looked relevant.
Thank you.
In case anyone else runs into this:
For Cinnamon desktop: go to Preferences > System Settings > Windows. Click on the Behavior tab. Change the "Special key to move and resize windows" from Alt to Disabled (or a different key).
Voila, alt-select works again in Notepad++!
(The Mint Forums answer linked above is for an older version but I have confirmed that this works on Mint 20.1 with Cinnamon 4.8.6.)

MSKLC under Windows 10: Create custom keyboard layout which supports IME (input method) for Chinese and combined input in Spanish

This question is originally posted by me in Microsoft Community at:
https://answers.microsoft.com/en-us/windows/forum/windows_10-other_settings/msklc-under-windows-10-create-custom-keyboard/8c5a7137-d575-4247-8ab3-b4dd1e5fb437?tm=1495318604424
In summary: I have created a custom keyboard layout with Microsoft Keyboard Layout Creator 1.4 in Windows 10, it is working but only partially. It cannot:
combine two keystrokes into one to type a "combined letter", e.g, "¨"+"u" = "ü". It should not exist in Chinese but I want to achieve this.
type Chinese pinyin and Chinese punctuation. In MS pinyin IME, I can press shift to switch between Chinese pinyin mode and English mode. Under pinyin mode I can convert letters into pinyin and thus get Chinese characters, but my layout lacks this. And, if I press "," in Microsoft Pinyin in pinyin mode, it should give me ","(full length comma), but this layout is not able to do this.
I am thinking about two ways to solve this:
Substitute Microsoft Pinyin's keyboard layout to my layout(replace the English part of MS Pinyin with my layout)
Copy the pinyin part of MS pinyin to my layout.
So, how can I solve this?
I have solved it.
For the first problem, you must define some "dead keys combinations". The details are explained here:
http://www.angelfire.com/planet/linguisticsisfun/Creating_a_Keyboard_Using_MSKLC.pdf
For the second problem, basically you do:
Create your keyboard layout.
Edit the .klc file with a Text Editor, to change the VK code mapping. That is because most of the applications in Microsoft Windows, when you press the hotkeys, detects VK code sent to OS, not the "key chars"(the characters output as you type in a text processing software). So in order to make the key chars of your keyboard layout to match with their VK code, you must do this manually. MSKLC will not change that for you. Some details here:
http://www.sensefulsolutions.com/2010/08/how-to-fix-keyboard-shortcuts-in-klc-eg.html
Install the layout.
Open your registry editor, enter HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layouts\, find your new keyboard layout at the bottom (mine with name like a0000xxxx). Copy the dll file name. That is the DLL file containing your newly created keyboard layout info.
Go back to the registry father branch, search the language you want to apply this layout, like Chinese or Spanish. You will find several variations with names alike, but the descriptions are self-explanatory and can help you differentiate them.
Simplified Chinese uses KBDUS.dll, that means "keyboard layout for US keyboard". This will apply to MS Pinyin, too. Change this value to your copied DLL name, so that it will load your DLL next time the OS launches.
Restart.
The result:
I can type English and Chinese pinyin with Microsoft Pinyin with my custom keyboard layout, and I can navigate next/previous page with , and ..
With this keyboard layout I can type Spanish special characters, like ï, á, ç, ñ and € without switching to Spanish keyboard.
Hotkeys in any software are working as expected, because now VK code are matched with letters printed on the keys.

Displaying Japanese text in the Immediate Window of Excel VBA

In Excel 2010, I have a worksheet containing Japanese text. There is no problem editing, or displaying this. When I grab the value of a cell containing Japanese and use Debug.Print to display it in the Immediate Window it appears as ???? This would be a familiar issue if I was dealing with a browser. I would just make sure everything was in UTF-8 encoding. I have Japanese installed on my English Windows and that's all working fine. In Excel I tried to set the default language to Japanese. I changed the editor font to Arial Unicode but so far I still get question marks. I contacted Microsoft. I was passed from one person to another, but they couldn't help. They offered to pass me to a Technical support person who would charge me 500 US dollars!
How can I debug Japanese values in an English version of Excel using the Immediate Window?
The VBA development environment depends on the Windows "system locale" setting to tell it what character set to use. I got it to work using
Windows Vista (English)
Excel 2010 (English)
by going into the "Regional and Language Options" section of the Windows Control Panel and setting the system locale to "Japanese (Japan)"
After my system rebooted I could see Japanese characters in the VBA Immediate Window:

How to map keyboard shortcut "select all" (CTRL+A) to "seleccionar todo" (CTRL+E) in windows application?

My desktop application is using shortcut (CTRL+A) to select all text from current focused window. My application runs in different localization including spanish language. But in spanish language it is not selecting all text by using (CTRL+A). (CTRL+A) in spanish is "open". "CTRL+E" is used to select all text from spanish (notepad). Can anyone tell me how to map these two shortcuts in windows desktop application? (os: windows xp, windows 7 (32 & 64) bits)
Thanks a lot
You can have multiple accelerator table resources, one for each locale. The resource editor should let you assign each accelerator table to a particular locale.
The documentation specifically mentions localization as a benefit of accelerator tables.

How do I change the code page MS Visual Studio 2008 uses to open files?

I have a cpp file that uses ibm cp437 and Visual C++ keeps reading it with windows-1252. How do I make Visual C++ use the right code page for the file?
Alright, I figured it out myself. For the curious, here is the answer:
Right click the file in the Solution Explorer.
Select "Open With..."
Choose "C++ Source Code Editor (with encoding)"
A new box appears to specify Encoding. Choose "OEM United States - Codepage 437"
Done.
I also encountered these errors in my environments. I think there's any easier way to change the default code pages.
In windows 10, you could go to "Settings" -> "Region" -> "Administrative" tab -> "Language for non-Unicode programs". Then you could choose the region you want.
In this way, all the codes read from Visual Studio would use the code page whatever you want.
For example, the default setting for me is Chinese (Traditional, Taiwan). The code page is 950. But the codes are using windows-1252, therefore, I change the region to English (United States).
That's it.
Hope the solution could help you.
Thanks.
Unless you need the CP437 encoding, why don't you convert it to CP1252, UTF-8 or MS 'Unicode' (UCS-2)? Any reasonably capable editor should be able to do it.
VS2008 can do it - check out the Advanced Save option on the File menu.
Edit:
If you go to Source Control Explorer, right-click on the file, select 'Properties', you can set the encoding on the 'General' tab page. 'IBM437' is one of the choices.

Resources