Results 1 to 8 of 8
Thread: Problem with String encodings
- 05-24-2011, 10:12 AM #1
Member
- Join Date
- Feb 2009
- Posts
- 96
- Rep Power
- 0
Problem with String encodings
Hi,
I have problems encoding Strings ,actually i am not good in encoding concept.
Actually what my requirement is to save exact file path of file something like
E:\temp in my sql database .Everything is fine except "\t" is saving like
"E: emp" "E:\temp " .please give me some idea to solve this problem.
Regarding
Sandeep
- 05-24-2011, 10:15 AM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 05-24-2011, 10:17 AM #3
Senior Member
- Join Date
- Apr 2010
- Location
- Philippines
- Posts
- 580
- Rep Power
- 4
Try
or use backslashJava Code:"E:\\temp"
Java Code:"E:/temp"
- 05-24-2011, 10:35 AM #4
Member
- Join Date
- Feb 2009
- Posts
- 96
- Rep Power
- 0
Thank u for quick reply.
The solution you mentioned is goes well when i statically give file path some thing like "E:/temp" .
Actually my requirement is user upload a file i save it in database with file path from where he is selecting the file.In this case case i don't know what exactly the location .The file location for user may contains some characters something like "\t" or "\n" or "\r" etc.. .In that case i can't use as you said.I need a some encoding concept to do this.Some thing like UTF-8 or Unicode encoding .I am not good in encoding . I am very great
full to you if you help me
- 05-24-2011, 10:43 AM #5
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
So there is some part in your software that translates, say, \t to a single tab character, right? If so, double all your \ characters if that software translates the character pair to a single \ character; otherwise find the translation rules of that piece of software because without them the question can't be answered.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 05-24-2011, 10:58 AM #6
Member
- Join Date
- Feb 2009
- Posts
- 96
- Rep Power
- 0
Thanks JoasH,
I already did what you said it goes well,but i am not looking for a only "\t" characters.I am looking for more robust code for all special characters ,may be in future i get situation where i need to store special characters(some thing like saving url where we have no of special characters).I am looking in that perspective . I just explained on example where i got problems in strings.Please consider in my point of view and if you have any ideas please suggest me.
- 05-24-2011, 11:27 AM #7
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
- 05-24-2011, 12:02 PM #8
Member
- Join Date
- Feb 2009
- Posts
- 96
- Rep Power
- 0
Similar Threads
-
String problem: deleting
By BlueBird in forum New To JavaReplies: 3Last Post: 03-18-2011, 05:21 AM -
string and condition problem
By durdanto in forum New To JavaReplies: 1Last Post: 02-17-2011, 08:20 AM -
Basic string problem, just need to extract two numbers out of string
By gonzoateafly in forum New To JavaReplies: 6Last Post: 12-06-2010, 09:26 AM -
File encodings
By JL4 in forum New To JavaReplies: 3Last Post: 11-23-2008, 05:09 PM -
String Problem
By gnomewise in forum New To JavaReplies: 1Last Post: 10-19-2008, 12:37 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks