YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

New Topic Post Reply
Does squirrel on Mac OSX support wide character?
noname1990
#1 Posted : Wednesday, January 08, 2014 4:22:48 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/8/2014(UTC)
Posts: 6
Location: Viet Nam

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
Hi everyone, I'm developing a project which use squirrel but it seems that squirrel does not support wide character on Mac OSX. Could someone confirm for me ?

Thanks a lot.
noname1990
#2 Posted : Friday, January 10, 2014 2:29:55 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/8/2014(UTC)
Posts: 6
Location: Viet Nam

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
Can anyone please answer me :((.
wizzard
#3 Posted : Friday, January 10, 2014 2:34:17 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 5/19/2013(UTC)
Posts: 133

Thanks: 4 times
Was thanked: 21 time(s) in 20 post(s)
Did you try defining _UNICODE when building?
noname1990
#4 Posted : Friday, January 10, 2014 3:16:33 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/8/2014(UTC)
Posts: 6
Location: Viet Nam

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
wizzard wrote:
Did you try defining _UNICODE when building?


Yes, but it turns out that when define _UNICODE, it will use the functions that are available on Windows, not Mac. Furthermore, some functions are available on both OS , they have different parameters input.

I've tried to fix and change some macros, but it's not working =.=

Thanks for your reply.
bluehazzard
#5 Posted : Friday, January 10, 2014 1:19:47 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 1/1/2013(UTC)
Posts: 58
Location: italy

Thanks: 14 times
Was thanked: 3 time(s) in 3 post(s)
why do you don't use utf8 for simplicity?
so you don't need the _UNICODE definition, and can use all simple c funtion... Mac is a unix port and i think all unix ports use utf8 or not?

greetings
noname1990
#6 Posted : Saturday, January 11, 2014 2:28:39 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/8/2014(UTC)
Posts: 6
Location: Viet Nam

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
bluehazzard wrote:
why do you don't use utf8 for simplicity?
so you don't need the _UNICODE definition, and can use all simple c funtion... Mac is a unix port and i think all unix ports use utf8 or not?

greetings


Hm yeah but I think it's only for displaying. But in here, I mean, for example, I want to compile the script like this

print("ハローワールド"); // I use google translate to translate Hello World to japanese

Edit: Ok, it ok to print.

I'm planing to call some C functions from Squirrel but the C functions output is in wchar_t* , so if I don't use unicode in Squirrel, I'll be in trouble.

Thanks.
bluehazzard
#7 Posted : Saturday, January 11, 2014 10:06:46 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 1/1/2013(UTC)
Posts: 58
Location: italy

Thanks: 14 times
Was thanked: 3 time(s) in 3 post(s)
My personal opinion is, that the whole unicode stuff is a pain in the ass... All this utf16 utf31 encoding make things complicated... You can't count the characters anyway easily so why you invent such things... use utf8 and your incompatibility problems are solved. It is expandable, you have space for all codepoints, endianess is no problem and you are compatible with old ASCII programs (to a certain degree).

converting from utf16 to utf8 is easy:
http://stackoverflow.com/a/4609989

if you are using c++11:
http://www.cplusplus.com...cvt/codecvt_utf8_utf16/

greetings
1 user thanked bluehazzard for this useful post.
noname1990 on 1/13/2014(UTC)
noname1990
#8 Posted : Monday, January 13, 2014 1:58:28 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/8/2014(UTC)
Posts: 6
Location: Viet Nam

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
bluehazzard wrote:
My personal opinion is, that the whole unicode stuff is a pain in the ass... All this utf16 utf31 encoding make things complicated... You can't count the characters anyway easily so why you invent such things... use utf8 and your incompatibility problems are solved. It is expandable, you have space for all codepoints, endianess is no problem and you are compatible with old ASCII programs (to a certain degree).

converting from utf16 to utf8 is easy:
http://stackoverflow.com/a/4609989

if you are using c++11:
http://www.cplusplus.com...cvt/codecvt_utf8_utf16/

greetings


Thank you. I'll think more about it. I don't like the unicode stuff too, but it's high level requirement >.< ...
noname1990
#9 Posted : Monday, January 13, 2014 4:25:22 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/8/2014(UTC)
Posts: 6
Location: Viet Nam

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
Thank you. I fixed it. The problem is I change to wide string but I do not change allocating virtual machine stuff. So it ends up crashing on release the virtual machine.
Quick Reply Show Quick Reply
Users browsing this topic
Guest
New Topic Post Reply
Forum Jump  
You can post new topics in this forum.
You can reply to topics in this forum.
You can delete your posts in this forum.
You can edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.

Clean Slate theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.128 seconds.