×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Converting Unicode characters

Converting Unicode characters

Converting Unicode characters

(OP)
Hi
In my tcl script I have this:
...
append p "B,confirmButton,\u2714,,Exit Ok;"
... 
that is used for generate a form button with caption the Unicode Lower Right Pencil.
When this is into a file this not appens i.e I am not be able to convert the below alternatives into a
desired caption.
B,execButton,✎,,tryForm;
B,execButton,\u270E; 
The file is coded utf8 without BOM.
tanks
John Rossati

RE: Converting Unicode characters

1) Do you want utf8 or utf16 type unicode?
2) Are you writing to a file or do you want it displayed in a GUI or a console
3) Are you using Linux or Windows

RE: Converting Unicode characters

(OP)
Thanks xwb
The file is coded utf8 without BOM; I am working on Windows and in my application I have both a TCL variable both a file text that contains \u270E and the first case Lower Right Pencil is showed correctly.
For the \u270E in a file I have found an answer i.e.:
...
        if {[file exists $params] == 1} {
		set fp [open $params r]
		set params [fg_Unicode [read $fp]]
		close $fp
	}
...
proc fg_Unicode {s} {
	set RE {[][{}\u0100-\uffff]}
	set substitution {[format \\\\u%04x [scan "\\&" %c]]}
	return [subst [regsub -all $RE $s $substitution]]
} 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close