[SCM] Multi-format 1D/2D barcode image processing library branch, upstream, updated. 24d4480bc48cf9eabf7b2bd2f528248b0e458809

vikrama vikrama at 59b500cc-1b3d-0410-9834-0bbf25fbcc57
Wed Aug 4 01:32:15 UTC 2010


The following commit has been merged in the upstream branch:
commit 2ecca4f2d5075168741b6d56e999b1d21c2332a4
Author: vikrama <vikrama at 59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Date:   Thu Jun 17 05:24:42 2010 +0000

    Escape the semicolons: this was easier than I imagined.  Tested with an ssid containing multiple semicolons.  Also some minor code cleanups.
    
    Still to be done:
    1. Rename 'nopass' to something cleaner, so it looks crisp in Android's Barcode Scanner UI.
    
    
    
    git-svn-id: http://zxing.googlecode.com/svn/trunk@1441 59b500cc-1b3d-0410-9834-0bbf25fbcc57

diff --git a/zxing.appspot.com/generator/src/com/google/zxing/web/generator/client/WifiGenerator.java b/zxing.appspot.com/generator/src/com/google/zxing/web/generator/client/WifiGenerator.java
index 3702448..1c8a6bc 100644
--- a/zxing.appspot.com/generator/src/com/google/zxing/web/generator/client/WifiGenerator.java
+++ b/zxing.appspot.com/generator/src/com/google/zxing/web/generator/client/WifiGenerator.java
@@ -32,12 +32,11 @@ public class WifiGenerator implements GeneratorSource {
   Grid table = null;
   TextBox ssid = new TextBox();
   TextBox password = new TextBox();
-  // Do not allow multiple selections, thus the false
-  ListBox networkType = new ListBox(false);
+  final boolean multipleSelections = false;
+  ListBox networkType = new ListBox(multipleSelections);
   TextBox[] widgets = {ssid, password };
   
-  public WifiGenerator(ChangeListener changeListener,
-      KeyPressHandler keyListener) {
+  public WifiGenerator(ChangeListener changeListener, KeyPressHandler keyListener) {
 	networkType.addItem("WEP", "WEP");
 	networkType.addItem("WPA/WPA2", "WPA");
 	networkType.addItem("No encryption", "nopass");
@@ -58,15 +57,12 @@ public class WifiGenerator implements GeneratorSource {
     String networkType = getNetworkTypeField();
     
     // Build the output with obtained data.
-    // note that some informations may just be "" if they were not specified.
-    //return getVCard(name, company, tel, url, email, address, memo);
     return getWifiString(ssid, password, networkType);
   }
 
   private String getWifiString(String ssid, String password, String type) {
     StringBuilder output = new StringBuilder();
     output.append("WIFI:");
-    // TODO(vikrama): Escape the semicolons in ssid and password
     output.append("S:").append(ssid).append(';');
     maybeAppend(output, "T:", type);
     maybeAppend(output, "P:", password);
@@ -88,10 +84,7 @@ public class WifiGenerator implements GeneratorSource {
     if (input.contains("\n")) {
       throw new GeneratorException(name + " field must not contain \\n characters.");
     }
-    if (input.contains(";")) {
-    	// TODO(viki): Escape semicolons and colons
-      throw new GeneratorException(name + " field must not contains ; characters");
-    }
+    input = input.replace(";", "\\;");
     return input;
   }
   

-- 
Multi-format 1D/2D barcode image processing library



More information about the Pkg-google-commits mailing list