Solved

Doubt about Charset Firebird

Posted on 2014-03-22
9
405 Views
Last Modified: 2014-03-22
Hello Guys,

I am in a terrible doubt. What charset should I use for a field?

I am creating an table where there is a field named "name", this field will keep the
user name, but the user name can be Greeck, Hebrew, Arabic, English, French, Italian, Spanish or portuguese. I am really in doubt what charset I should use to it. Is there any that can handle with all kind of characters?

Help me on this

Thanks
Alexandre
0
Comment
Question by:hidrau
  • 5
  • 4
9 Comments
 
LVL 34

Expert Comment

by:Dan Craciun
ID: 39947629
UTF-8 should work.

HTH,
Dan
0
 
LVL 1

Author Comment

by:hidrau
ID: 39947638
Hello Dan, thanks for replying me.

so, UTF-8 can keep hebrew, arabic, portuguese, english etc words?

if so, I can have only one field for all these languages that I need to work and I am very glad to know that :)
0
 
LVL 34

Accepted Solution

by:
Dan Craciun earned 500 total points
ID: 39947647
Yes, UTF-8 can represent all Unicode characters. See here: https://en.wikipedia.org/wiki/UTF-8

This does not mean that you can simply insert anything in it and it will work.
Just that if you have UTF-8 encoded text (arabic, hebrew, english etc) you will be able to store it and retrieve it.

If, on the other hand, your text has some other encoding, you'll need to convert it to UTF-8 before inserting in the database.
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 1

Author Comment

by:hidrau
ID: 39947665
Ok,

Dan, imagine that I need to insert a name like this " alexandre " that is Portuguese in my name field. as I understood, for each character of that name I'll have 2 bites, now, if I need to insert a hebrew name / word like ¿¿¿¿¿¿¿¿¿¿¿ for each character I will have 4 bites, right?

If so, then for this word ¿¿¿¿¿¿¿¿¿¿¿ that has 5 character I must have a varchar field with 20.

That is an example, because I can have a word with 15 hebrew character.
0
 
LVL 34

Expert Comment

by:Dan Craciun
ID: 39947672
Don't know the details in Firebird, but I would assume that for UTF-8 encoding, if you declare varchar(20) it will always have 80 bytes (4 bytes/char).
0
 
LVL 1

Author Comment

by:hidrau
ID: 39947686
hummm,

Let me see whether I got it.

varchar(20) will keep 20 characters, it doesn't mind if it is English, Portuguese, Hebrew or Arabic. It will keep 20 characters and for each character I will have 4 bites using UTF8, am I right Dan?
0
 
LVL 34

Expert Comment

by:Dan Craciun
ID: 39947694
Yup, that's about right, AFAIK.
0
 
LVL 1

Author Comment

by:hidrau
ID: 39947700
Ok Dan.

Thanks very much for your help. You helped me a lot to understand it.
0
 
LVL 34

Expert Comment

by:Dan Craciun
ID: 39947725
Glad I could help!
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
query returning everything 11 105
powershell and sql server - alerting 7 87
use lov values 2 49
T-SQL: Do I need CLUSTERED here? 13 41
This article describes some very basic things about SQL Server filegroups.
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question