             (-write writer
                     (capitalize-string (.toLowerCase s) @last-was-whitespace?))
             (when (pos? (.-length s))
-              (reset! last-was-whitespace? (is-whitespace? (nth s (dec (count s)))))))
+              (reset! last-was-whitespace? (gstring/isEmptyOrWhitespace (nth s (dec (count s)))))))
 
           js/Number
           (let [c (char x)]
             (let [mod-c (if @last-was-whitespace? (string/upper-case c) c)]
               (-write writer mod-c)
-              (reset! last-was-whitespace? (is-whitespace? c)))))))))
+              (reset! last-was-whitespace? (gstring/isEmptyOrWhitespace c)))))))))
 
 (defn- init-cap-writer
   "Returns a proxy that wraps writer, capitalizing the first word"


          js/Number
          (let [c (char x)]
            (if (and (not @capped) (is-letter? c))
              (do
                (reset! capped true)
                (-write writer (string/upper-case c)))

          ;;TODO need to enforce integers only?
          (-write writer (string/upper-case (char c))))))))

(defn- capitalize-string
  "Capitalizes the words in a string. If first? is false, don't capitalize the
                                      first character of the string even if it's a letter."
  [s first?]
  (let [f (first s)
        s (if (and first? f (gstring/isUnicodeChar f))
            (str (string/upper-case f) (subs s 1))
            s)]
    (apply str
