ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Jaroslav Hajtmar <hajtmar@gyza.cz>
Cc: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Problem with \doifelse testing of UTF-8 chars
Date: Thu, 22 Apr 2010 21:55:37 +0200	[thread overview]
Message-ID: <4BD0A9B9.6010901@gyza.cz> (raw)
In-Reply-To: <4BD0A47D.9050306@elvenkind.com>

Hello.
Thank for your advise.
I was tried your example, but it is not working unfortunately too.
I previwed CSV file -  it is UTF-8 encoding and hexa code of "m" 
character is 6D00. This mean that "m" char is byte coding isnt it?
Exist any way untwist my problem now?

Thanx Jaroslav



   In hexa editor is Dne 22.4.2010 21:33, Taco Hoekwater napsal(a):
> 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)
>
> Does it contain a character or a byte from the CSV? This is a
> very important difference.
>
>> % I compare e.g. "m" character and content of macro  \onecharfromcsvfile
>> \def\result{\doifelse{m}{\onecharfromcsvfile}{true}{false} }
>>
>> \result is however always false
>
> Well, that depends on whether m's in your csv file, and how 
> \onecharfromcvsfile is actually defined. This reports true:
>
> \starttext
> \def\onecharfromcsvfile{m}
> \def\result{\doifelse{m}{\onecharfromcsvfile}{true}{false} }
> \result
> \stoptext
>
>
> Best wishes,
> Taco
>

___________________________________________________________________________________
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
___________________________________________________________________________________


  reply	other threads:[~2010-04-22 19:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-22 18:57 Jaroslav Hajtmar
2010-04-22 19:33 ` Taco Hoekwater
2010-04-22 19:55   ` Jaroslav Hajtmar [this message]
2010-04-22 19:59     ` Taco Hoekwater
2010-04-22 20:17       ` Jaroslav Hajtmar
2010-04-22 21:44         ` Taco Hoekwater
2010-04-22 21:28 ` Hans Hagen
2010-04-22 22:30   ` Jaroslav Hajtmar
2010-04-23 12:31     ` Mojca Miklavec
2010-04-23 16:25       ` Hans Hagen
2010-04-23 16:29         ` Mojca Miklavec
2010-04-23 16:30       ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BD0A9B9.6010901@gyza.cz \
    --to=hajtmar@gyza.cz \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).