On 22-4-2010 8:57, Jaroslav Hajtmar wrote:
Hello,
I have problem with testing of strings through \doifelse.
I am loading data from external CSV file. CSV file is UTF-8 encoding.
Data from external file I am reading to ConTeXt macro and I want compare
content of macro (it is one utf-8 character) and other character as per
example:
(\onecharfromcsvfile contains one character from external CSV file)
% I compare e.g. "m" character and content of macro \onecharfromcsvfile
\def\result{\doifelse{m}{\onecharfromcsvfile}{true}{false} }
\result is however always false
When CSV file is CP-1250 encoding then macro does work right as well as
classical TeX macro:
\def\result{\if m\onecharfromcsvfile true\else false \fi}
My question is:
Just how modify macro as to work right when CSV file is UTF-8 encoding.
tricky as utf in mkii is using active chars ... it all depends a bit to
what the character expands; depending on the macro one can also use
\convertargument#1\to\whatever like constructs and then compare the
\whatever
Thanx Jaroslav
PS: I was working up until now only with CP-1250 encoding, but when I
started with LuaTeX (MKIV), then I have to use UTF-8. (MKIV dont work
corectly with external CP-1250 files).
oh? regimes are supposed to work ok in mkiv
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________