Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

synchronizing criteriaFind() & UTF encoding

 
Ravikiran Choppalli
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I've the following question :
1. I'm wondering whether the criteriaFind() method needs to be synchronized, since this is also called by various clients simultaneously !
2. While changing the methods in Data Class to remove deprecated methods, I need some clarification on using System default for Character encoding and UTF8 or UTF16.
Thanks in advance.
- Ravi.
 
KH Yau
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
utf8
 
Ravikiran Choppalli
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yau,
Thanks for the suggestion. But I need clarification why to use that only !
Thanks,
- Ravi.
 
KH Yau
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know! It worked - that's all!
 
KH Yau
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok - i do notice smthg from the deprecated method which led to the decision to use UTF8 instead of 16. The deprecated method has an input argument 0 for "hiint" (check the api). I interpreted it as discarding the high-byte of the unicode. So only 8-bit is used, i.e. UTF8 - hope this help!
 
Conor Allen
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there really anything wrong with using the default character encoding?
Anyone?
Conor
 
Lance Finney
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the same question as Conor. I've just started on my SCJD, and I replaced the deprecated methods with the ones that use default encoding, and it seemed to work. Is there something I'm missing?
 
Gregory Golberg
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Correct me if I'm wrong, but it shouldn't matter. Only
the least significant byte is used anyway to write to the
file. So UTF-16 should not be used by the caller, else
the data will end up screwed up - which I pointed out
in one of the threads as a deficiency of the provided code.
The "intern" who wrote it advertized public methods as
accepting Strings, although behind the scenes he uses
bytes. So, I'd say, pointing this out in the docs
shouldn't hurt (I am going to do that), and then it
doesn't really matter... Unless you want to rewrite
DataInfo and FieldInfo to only accept UTF-8 values
(which the "intern" should have done), and not use
Strings in Data at all - just use DataInfo and FieldInfo.
Which is what he or she should have done as well.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic