When I enter "Se cambiarán los bornes" (please note the accent), in a LiveCode field, the text is properly shown, writting it to a Mongo collection also works fine, the field is saved OK in the document, I can see it using the Shell, but when retrieving the document back to LiveCode, the field receiving the field shows: "Se cambiarÃan los bornes". Trying to find the reason I found that the encoding of field "resul" is Native. Can you help finding the way to make this strings show the right characters?
The code retrieving the document from the database is:
on mouseUp
local theMongo, theDB, dbText, theCole, thePreg, theQuerry
put empty into field resul
put "C:\mongodb\bin\mongo.exe localhost:27017/" into theMongo
put "BatGar" into theDB
put "BatRegis"into theCole
put "'" & field F1 & "'" into toFind
put "{"& quote & "_id" & quote & ":" & toFind & "}" into thePreg
put "; printjson(db.getLastError())" into dbErr
put ".find(" & thePreg & ");"into theQuerry
put "var c=db."& theCole & theQuerry into dbText
put " while(c.hasNext())" after dbText
put " printjson(c.next())" after dbText
put dbErr after dbText
put theMongo & theDB && "--eval" && quote & dbText & quote into dbText1
put shell ( quote &dbText1 & quote) into dbResultado
put the number of lines of dbResultado into nro
put line 3 to (nro - 1) of dbResultado into field resul
if field resul is empty then
Answer warning "El Documento NO ha sido encontrado. El sistema no tiene registrada una Batería con el ID: " & field F1 with OK
else
Answer warning "El Documento ha sido encontrado, ID: " & field F1 with OK
end if
Retrieving a MongoDB Document with accents
Creating desktop or client-server database solutions?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Jump to
- LiveCode Community
- ↳ Announcements
- ↳ Developer Services Marketplace
- ↳ User Groups and Events
- ↳ SoCal LiveCode Group
- ↳ Greater Toronto Area LiveCode Users Group
- ↳ Off-Topic
- ↳ Made With LiveCode
- Getting Started With LiveCode
- ↳ Getting Started with LiveCode - Complete Beginners
- ↳ Getting Started with LiveCode - Experienced Developers
- ↳ Converting to LiveCode
- ↳ App Building Course
- ↳ Simple Messages
- ↳ Calculator
- ↳ Notes
- ↳ Clock
- ↳ Web Browser
- ↳ Weather
- ↳ Compass
- ↳ Photos
- Developing With LiveCode
- ↳ Talking LiveCode
- ↳ Databases
- ↳ Games
- ↳ Internet
- ↳ Multimedia
- ↳ Software Engineering
- ↳ Version Control
- ↳ Feature Proposals
- ↳ Bug Triage
- ↳ Legacy Project: MetaCard
- Extending LiveCode
- ↳ Using Plugins for Customizing the LiveCode IDE
- ↳ Using Externals
- ↳ Making IDE Plugins
- ↳ Building Externals
- ↳ LiveCode Builder
- Platform Specific
- ↳ Windows
- ↳ Mac OS
- ↳ Linux
- ↳ iOS Deployment
- ↳ Android Deployment
- ↳ CGIs and the Server
- ↳ HTML5
- ↳ Raspberry Pi
- Academic Endeavors
- ↳ Teaching with LiveCode
- ↳ Research and Post Secondary
- ↳ LiveCode University
- ↳ Educational Outreach
- Livecode Open Source Archived Forum- closed to posting
- ↳ Engine Contributors
- ↳ IDE Contributors
- ↳ Documentation and Tutorials
- ↳ Brainstorms
- ↳ Community Projects
- ↳ rIDE
- Third Party Extension Support
- ↳ Marketing Your Products
- ↳ Animation Engine
- ↳ chartsEngine
- ↳ MobGUI
- ↳ lcTaskList
- ↳ SQL Yoga
- ↳ MergEXT
- ↳ Data Grid Helper
- ↳ idea2app and Coding School
- ↳ Admin Archive
- LiveCode Hosting
- Forum Archives
- ↳ Archived: Third Party Extension Support
- ↳ rTree
- ↳ rGrid
- ↳ Data Tree
- ↳ Archived: LiveCode Open Source
- ↳ LiveCode Global Jam
- ↳ Testing Support
- ↳ Archived: Academic Endeavors
- ↳ September Academy
- ↳ Summer School 2013
- ↳ Archived: Project Specific
- ↳ Business and Kiosks
- ↳ Digital Art and Portfolios