This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General Discussion
 General Discussion
 words in the online dictionary turn to be "???"
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

lyfd123

3 Posts

Posted - 03/26/2017 :  23:57:24  Show Profile
Hi, when I use the following codes to search Korean word in an online dictionary http://cndic.naver.com/, the word in the browser's bar just turns to be "???". I'm using the Windows 10 of Chinese version and either English or Chinese words in the dictionary have no problem with "???". I would appreciate it if you could help me out




testing codes are here and you should copy some Korean words in the dictionary website to test the codes because I can't offer them for you, this forum could not show Korean correctly:

acSendKeys("^c")
local key=acGetClipboardText()
key=string.gsub(key,"%s","%%20")
key="http://cndic.naver.com/search/all?q="..key;


Edited by - lyfd123 on 03/27/2017 00:09:26

Rob

USA
2615 Posts

Posted - 03/27/2017 :  00:08:29  Show Profile  Visit Rob's Homepage
Unfortunately, S+ was written and compiled using ANSI, not Unicode. So it doesn't recognize non-ANSI characters in scripts.

I have started working on a new version which will support Unicode characters, but I've been very busy and it will not be ready for a long time.
Go to Top of Page

lyfd123

3 Posts

Posted - 03/27/2017 :  01:49:22  Show Profile
That's OK, thank you for your reply, I'll look forward for it.

Edited by - lyfd123 on 04/04/2017 19:50:41
Go to Top of Page

tia34531

18 Posts

Posted - 03/28/2017 :  20:58:24  Show Profile
Try this. Iam not sue if it works, though.

http://cndic.naver.com/search.naver?ie={inputEncoding}&query=

Edited by - tia34531 on 03/31/2017 08:05:45
Go to Top of Page

lyfd123

3 Posts

Posted - 04/04/2017 :  19:50:26  Show Profile
quote:
Originally posted by tia34531

Try this. Iam not sue if it works, though.

http://cndic.naver.com/search.naver?ie={inputEncoding}&query=


Thank you, I tried it and still doesn't work.
Go to Top of Page

nober

29 Posts

Posted - 07/26/2020 :  10:43:24  Show Profile
As I just found out, it is possible for this to work, but it requires setting Windows system locale to the same language as the target text, and the way in which software sets text to clipboard, i.e. copy non-latin characters from chromium-based browsers such as Opera or Chrome doesn't work.

For example, having system locale set to Korean (Korea), using Internet Explorer(-based browser such as Maxthon) or FireFox, to copy Korean text on a webpage and search it from an address bar, the following code would work (I added codes below to set ANSI text to clipboard as I think that's what the user would want, i.e. to paste and enter).


acSendKeys'^c'
os.execute('echo ' .. 'http://cndic.naver.com/search/all?q=' .. acGetClipboardText():gsub('%s', '%%20') .. '|clip') -- "clip" requires Windows 7 or above; it's a workaround for acSetClipboardText() with non-latin text
acSendKeys'%d^v~'


Update: for future reference, for those who stumble upon this. After more working with non-ASCII text, the first paragraph should be edited to: (...from chromium-based browsers such as Opera or Chrome doesn't work) when the keyboard language is not is the same language as the target language. When keyboard language is the same as the target language, chromium-based browsers, and StrokesPlus acSetClipboard() will work.
But two heads up:
* Non-ascii texts in internal StrokesPlus script will render StrokesPlus.xml non-parseable, as StrokesPlus will write ASCII text as UTF-8, so the xml file cannot be edited programmatically, though reading and editing as raw text still works.
* Not every character in the target language is supported in StrokesPlus even with locale changed.

Edited by - nober on 11/14/2020 00:55:30
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000