Re: crash in guile-sqlite3
On Sun 29 Apr 2012 03:58, Sunjoong Lee writes: > Yesterday, David said simple solution of yours. I think I found the case > of segfault. Nice! Would you mind sending a pull request on gitorious? Preferably we could add a test case too. Cheers, Andy -- http://wingolog.org/
Re: I'm looking for a method of converting a string's character encoding
On Sat, Apr 28, 2012 at 10:55 PM, Eli Zaretskii wrote: > One notable example is when the original encoding was determined > incorrectly, and the application wants to "re-decode" the string, when > its external origin is no longer available. Okay, but then I would suggest either if you know you're probably not getting the right encoding but can determine it later to only store the input as a bytevector and later decode it correctly. Or if you already have the string you could encode it back to a bytevector with the wrong guessed encoding (which should emit the original input I think) and then re-decode it with the right encoding. Wouldn't that be the same solution as adding a primitive which does the same thing but on some lower level? > Another example is an > application that wants to convert an encoded string into base-64 (or > similar) form -- you'll need to encode the string internally first. Here I don't have enough experience, but wouldn't you then just again transform the string into a bytevector and further work with it? > IOW, Guile needs a way to represent a string encoded in something > other than UTF-8, and convert between UTF-8 and other encodings. I think strings should be encoding `independent', so you don't have to mind that if you don't need to, and if you're working with a special encoding you're working on a representation of the `text' as a number of characters encoded in some numbers, so you use a bytevector. The only thing I'm not sure about is whether guile supports encoding a string (into a bytevector) in some other format than UTF-8, so if there don't exist other procedures I would suggest adding a string to bytevector decoder which takes an encoder and the encoders (or just procedures which convert the string directly into a bytevector in a specific encoding). WDYT?
Re: crash in guile-sqlite3
2012/4/30 Andy Wingo > > Would you mind sending a pull request on gitorious? Preferably we could > add a test case too. > I apologize for my poor english; I'm willing to "send a pull request on gitorious" but don't know what means that sentence. Joonas had reported that Segmentation fault crash will be occur in guile-sqlite3 when you use sqlite-bind with a string; I think he would suspect it as sqlite-finalize's problem. I realized sqlite-bind treats sqlite-transient as a pointer and it would occur same Segmentation fault when you with bytevector; only numerical value will work well. That's because sqlite3_bind_blob and sqlite3_bind_text of libsqlite3 expect it's last argument as a function pointer or just uint64_t type of 0x or 0x; you can use C function if sqlite-transient be it but you should use 0x or 0x if not so, and the meaning of SQLITE_TRANSIENT is it's a 0x. Joonas, would you mind sending a pull request on gitorious?
Re: crash in guile-sqlite3
On Mon 30 Apr 2012 12:32, Sunjoong Lee writes: > 2012/4/30 Andy Wingo > > Would you mind sending a pull request on gitorious? Preferably we could > add a test case too. > > I apologize for my poor english; I'm willing to "send a pull request on > gitorious" but don't know what means that sentence. No problem, and no need to apologize :) What it means is to go to: https://gitorious.org/guile-sqlite3 Create an account and log in. Then go back to: https://gitorious.org/guile-sqlite3 And click "Clone this repository". That will give you a Git repository for guile-sqlite3, on gitorious. Then, you do the "git clone ssh://", make your change, "git commit" it locally, then "git push" to the origin. When that is done, there is a button in the web interface to "request a pull", meaning, request that dzu (or me) merges your changes to the "main repository". There are other ways to do this, but if you are willing to try this one, it is the best. Let me know if you have questions, and thanks for hacking Guile! Andy -- http://wingolog.org/
Re: I'm looking for a method of converting a string's character encoding
> Date: Mon, 30 Apr 2012 12:18:59 +0200 > From: Daniel Krueger > Cc: t...@gnuvola.org, guile-user@gnu.org, sunjo...@gmail.com > > I think strings should be encoding `independent', so you don't have to > mind that if you don't need to, and if you're working with a special > encoding you're working on a representation of the `text' as a number > of characters encoded in some numbers, so you use a bytevector. That would do, I think. > The only thing I'm not sure about is whether guile supports encoding a > string (into a bytevector) in some other format than UTF-8, so if > there don't exist other procedures I would suggest adding a string to > bytevector decoder which takes an encoder and the encoders (or just > procedures which convert the string directly into a bytevector in a > specific encoding). > > WDYT? Sounds like a plan to me ;-)
Re: crash in guile-sqlite3
Hi, Andy; Where is a "request a pull" button? I tried somethings; one of them makes 3e2add75. I don't know what's exactly work but https://gitorious.org/guile-sqlite3 display "sunjoong committed 3e2add75 on April 30, 2012 13:23". Now, the time to "pull request." 2012/4/30 Andy Wingo > > What it means is to go to: > > https://gitorious.org/guile-sqlite3 > > Create an account and log in. Then go back to: > > https://gitorious.org/guile-sqlite3 > > And click "Clone this repository". That will give you a Git repository > for guile-sqlite3, on gitorious. > > Then, you do the "git clone ssh://", make your change, "git commit" > it locally, then "git push" to the origin. > > When that is done, there is a button in the web interface to "request a > pull", meaning, request that dzu (or me) merges your changes to the > "main repository". > Thanks.