Author Topic: non-english windows clipboard problem  (Read 3967 times)

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: non-english windows clipboard problem
« Reply #15 on: February 12, 2022, 10:05:29 AM »
deleted
« Last Edit: February 24, 2022, 05:02:49 PM by nidud »

jj2007

  • Member
  • *****
  • Posts: 13957
  • Assembly is fun ;-)
    • MasmBasic
Re: non-english windows clipboard problem
« Reply #16 on: February 12, 2022, 03:05:36 PM »
Nidud, I am so sorry that your tools don't allow to work with all languages supported by Windows :tongue:




bomz

  • Member
  • **
  • Posts: 60
Re: non-english windows clipboard problem
« Reply #17 on: February 12, 2022, 04:38:12 PM »
Thanks. Why this don't work?
invoke LoadKeyboardLayout,0419h, KLF_ACTIVATE

http://d.radikal.ru/d34/2202/dd/bc95aced2e17.jpg
http://d.radikal.ru/d17/2202/11/ab7ada8b1edf.jpg
http://a.radikal.ru/a33/2202/87/64ad05119bf2.jpg


invoke ActivateKeyboardLayout,HKL_NEXT,0  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
invoke ActivateKeyboardLayout,0419h,0 - RUS
invoke ActivateKeyboardLayout,0409h,0 - ENG

« Last Edit: February 12, 2022, 08:05:10 PM by bomz »

TimoVJL

  • Member
  • *****
  • Posts: 1320
Re: non-english windows clipboard problem
« Reply #18 on: February 12, 2022, 08:26:41 PM »
Win32 have function MultiByteToWideChar(CP_UTF8, 0, ... and WideCharToMultiByte(CP_UTF8, 0, .. for UTF-8 strings.
Web pages are mostly UTF-8 and also MS help files.


EDIT:
The sad history of Unicode printf-style format specifiers in Visual C++

Free Clipboard Viewer
May the source be with you

bomz

  • Member
  • **
  • Posts: 60
Re: non-english windows clipboard problem
« Reply #19 on: February 12, 2022, 08:46:06 PM »

jj2007

  • Member
  • *****
  • Posts: 13957
  • Assembly is fun ;-)
    • MasmBasic
Re: non-english windows clipboard problem
« Reply #20 on: February 12, 2022, 08:59:47 PM »
Win32 have function MultiByteToWideChar(CP_UTF8, 0, ... and WideCharToMultiByte(CP_UTF8, 0, .. for UTF-8 strings.
Web pages are mostly UTF-8 and also MS help files.

Even Explorer, it seems (except in Norway). On the surface, at least - under the hood, it's surely UTF-16.

bomz

  • Member
  • **
  • Posts: 60
Re: non-english windows clipboard problem
« Reply #21 on: February 12, 2022, 09:39:14 PM »
invoke GetClipboardData,CF_UNICODETEXT
invoke MessageBoxW,0,eax,addr mestitle,MB_ICONASTERISK

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: non-english windows clipboard problem
« Reply #22 on: February 13, 2022, 02:14:17 AM »
deleted
« Last Edit: February 24, 2022, 05:03:18 PM by nidud »

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: non-english windows clipboard problem
« Reply #23 on: February 13, 2022, 04:31:12 AM »
deleted
« Last Edit: February 24, 2022, 05:03:35 PM by nidud »

jj2007

  • Member
  • *****
  • Posts: 13957
  • Assembly is fun ;-)
    • MasmBasic
Re: non-english windows clipboard problem
« Reply #24 on: February 13, 2022, 06:03:19 AM »
include \masm32\MasmBasic\MasmBasic.inc         ; download
$Data 你在胡说八道,我的朋友!
$Data Mluvíš nesmysly, příteli!
$Data Вы говорите глупости, мой друг!
$Data أنت تتحدث عن هراء يا صديقي!
$Data אתה מדבר שטויות, ידידי!
$Data あなたはナンセンスを話している、私の友人!
  Init
  Read my$()
  wMsgBox 0, wRec$(Join$(my$())), "Windows works fine everywhere in the World", MB_OK
EndOfCode


And guess what, friend from Norway, it doesn't even need MasmBasic - see attachment PureMasm32SDK :tongue:

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 10583
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: non-english windows clipboard problem
« Reply #25 on: February 13, 2022, 08:23:44 AM »
I honestly don't know what the big deal is here, Windows has supported UNICODE since 1994 in NT4 and with UNICODE fonts, you can produce just about any language on the planet. Natural languages that can be represented with single byte character sets can use the old code page system but it was a pain to use where UNICODE easily handled entirely different language and character formats, Chinese, Japanese, Georgian, Russian etc .....

I am lazy in that as an English speaker, ASCII does the job in most instances where UNICODE requires storing string data in a different manner.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

TimoVJL

  • Member
  • *****
  • Posts: 1320
Re: non-english windows clipboard problem
« Reply #26 on: February 13, 2022, 08:39:00 AM »
Windows NT was born from start with UNICODE, like Windows NT 3.1
May the source be with you

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: non-english windows clipboard problem
« Reply #27 on: February 13, 2022, 09:29:39 AM »
deleted
« Last Edit: February 24, 2022, 05:03:51 PM by nidud »

bomz

  • Member
  • **
  • Posts: 60
Re: non-english windows clipboard problem
« Reply #28 on: February 13, 2022, 02:46:14 PM »
 :cool:

Greenhorn

  • Member
  • ***
  • Posts: 493
Re: non-english windows clipboard problem
« Reply #29 on: February 13, 2022, 07:38:54 PM »
Since NT, Windows is internally using Unicode only (since Windows 2000 this is UTF-16). All the ASCII functions of the win32 API are just Wrappers which allocate additional memory to convert the ASCII string and then call the Unicode version of the function and vice versa. They do only exist because of compatibility reasons with old applications.

"New applications"(sic!) should use Unicode in general.
Kole Feut un Nordenwind gift en krusen Büdel un en lütten Pint.