Author Topic: How import cyrillic character data from Excel file ?  (Read 2439 times)

0 Members and 1 Guest are viewing this topic.

Vandyck

  • Newt
  • Posts: 24
How import cyrillic character data from Excel file ?
« on: March 11, 2015, 07:35:27 PM »
I use the wonderful GetExcel.lsp library by Terry Miller to read data from Excel file.

But, when data are coded in cyrillic characters VisualLisp don't support Unicode :-( , the result is "? ? ? ?" strings

See the attached file
"test_unicode.xls", where A1 cell is in cyrillic char, B1 cell is normal text (for me).
and try: (GetExcel "C:\\test_unicode.xls" "Sheet1" "A1") => (("? ? ? ? ?"))

Some ideas ? (I think to export data in unicode .txt file...)
GetExcel.lsp is here: http://web2.airmail.net/terrycad/LISP/GetExcel.lsp

NICK_VNV

  • Newt
  • Posts: 63
Re: How import cyrillic character data from Excel file ?
« Reply #1 on: March 12, 2015, 04:38:18 AM »
I've got (GetExcel "e:\\test_unicode.xls" "Sheet1" "A1") ==> (("ПАЛЕЦ"))
seems problem is somwhere else
Sorry for my English...

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: How import cyrillic character data from Excel file ?
« Reply #2 on: March 12, 2015, 04:54:46 AM »
Maybe the font used for the command window is causing the problem.

NICK_VNV

  • Newt
  • Posts: 63
Re: How import cyrillic character data from Excel file ?
« Reply #3 on: March 12, 2015, 05:00:30 AM »
Maybe the font used for the command window is causing the problem.
Try to paste result as text to model to check it:
Code: [Select]
(command "_text" (getpoint) 3 0 (caar(GetExcel "c:\\test_unicode.xls" "sheet1" "a1")))
« Last Edit: March 12, 2015, 05:04:32 AM by NICK_VNV »
Sorry for my English...

Vandyck

  • Newt
  • Posts: 24
Re: How import cyrillic character data from Excel file ?
« Reply #4 on: March 12, 2015, 06:41:24 AM »
thank you for the answers

if I copy&paste the "ПАЛЕЦ" string in the graphics area I get an correct entity TEXT string.

But the problem is in VLISP... he does not seem to manage this data :-(

I use Window7 64bit, Autocad 2013 and the code page (getvar "syscodepage") is "ANSI_1252".
maybe it's something related to system codepage ? Uhmmm... but, for example , when I paste "ПАЛЕЦ" in NOTEPAD the text is ok.

Nick_VNV, which codepage have you?

NICK_VNV

  • Newt
  • Posts: 63
Re: How import cyrillic character data from Excel file ?
« Reply #5 on: March 12, 2015, 07:57:08 AM »
I use Window7 64bit, Autocad 2013 and the code page (getvar "syscodepage") is "ANSI_1252".
....
Nick_VNV, which codepage have you?
I have ANSI_1251.
ANSI_1252 is not cyrillic(!) See difference on https://ru.wikipedia.org/wiki/ISO_8859-1 and https://ru.wikipedia.org/wiki/Windows-1251.
Maybe you have installed Autocad with incorrect language?
« Last Edit: March 12, 2015, 08:02:17 AM by NICK_VNV »
Sorry for my English...