are there any flags like : -D_UCS2 -D_UNICODE in you app?


Others, for you problem, i include "CLucene/config/repl_wchar.h"
it works.
but in the cl_demo's SearchFiles.cpp,  it also include 
"CLucene/config/repl_tchar.h".  i'm confused too.

在2009-10-20,"Michel Nadeau" <aka...@gmail.com> 写道:
Thanks! It works perfectly!

Side question: how can I compile my app in unicode mode? (I use CMake)

- Mike
aka...@gmail.com



On Tue, Oct 20, 2009 at 10:03 AM, Itamar Syn-Hershko <ita...@divrei-tora.com> 
wrote:

It seems like you're compiling in ASCII mode (non-Unicode). If this 
intentional, and you need to have your app that way for some reason, try this:
 
_tprintf(_T("Field: %S, Value: %S\n"), tField, tValue);


From: Michel Nadeau [mailto:aka...@gmail.com] 
Sent: Tuesday, October 20, 2009 3:51 PM
To:clucene-developers@lists.sourceforge.net
Subject: [CLucene-dev] STRCPY_AtoT - First letter only?


Hi !

This problem isn't really related to CLucene... but I really can't find any 
solution.

I ported my CLucene 0.9.23 code to CLucene 2.3.2 (so also from normal Makefile 
to CMake).

See this test code in my CLucene project:


// Static
const long  LEN_SHORT = 256;
const long  LEN_HUGE  = 200000;

// TCHAR
TCHAR       tField[LEN_SHORT];
TCHAR       tValue[LEN_HUGE];

// char strings
char        sFieldName[LEN_SHORT] = {0};
char        sFieldValue[LEN_HUGE] = {0};

// Test
strcpy(sFieldName, "field");
strcpy(sFieldValue, "value");

STRCPY_AtoT(tField, sFieldName,  sizeof(sFieldName));
STRCPY_AtoT(tValue, sFieldValue, sizeof(sFieldValue));

_tprintf(_T("Field: %s, Value: %s\n"), tField, tValue);


In my CLucene 0.9.23 project, this code would output (as it should) :


Field: field, Value: value


But in my CLucene 2.3.2 project, the same code outputs:


Field: f, Value: v


I ALWAYS get ONLY the first letter when I _tprintf something - no idea why! I 
use the same conversion method to insert fields/values in CLucene and so far 
I'm still not 100% sure if it's only an output problem (_tprintf) or if the 
TCHAR really contain only the first letter after the conversion (STRCPY_AtoT).

Any idea?? Thanks!!

- Mike
aka...@gmail.com


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
CLucene-developers mailing list
CLucene-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/clucene-developers






"雪见"杨幂邀你共品3D国韵网游《天下贰》,海报免费领
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
CLucene-developers mailing list
CLucene-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/clucene-developers

Reply via email to