Solved

Doubt about Charset Firebird

Posted on 2014-03-22
9
409 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 35

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 35

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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
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 35

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 35

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 35

Expert Comment

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

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Read about achieving the basic levels of HRIS security in the workplace.
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
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…

749 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